Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventLoop ¶
type EventLoop struct {
// contains filtered or unexported fields
}
EventLoop ...
func (*EventLoop) Run ¶
Run calls the specified function, starts the event loop and waits until there are no more delayed jobs to run after which it stops the loop and returns. The instance of goja.Runtime that is passed to the function and any Values derived from it must not be used outside of the function. Do NOT use this function while the loop is already running. Use RunOnLoop() instead.
func (*EventLoop) RunOnLoop ¶
RunOnLoop schedules to run the specified function in the context of the loop as soon as possible. The order of the runs is preserved (i.e. the functions will be called in the same order as calls to RunOnLoop()) The instance of goja.Runtime that is passed to the function and any Values derived from it must not be used outside of the function.
func (*EventLoop) Start ¶
func (loop *EventLoop) Start()
Start the event loop in the background. The loop continues to run until Stop() is called.
func (*EventLoop) Stop ¶
func (loop *EventLoop) Stop()
Stop the loop that was started with Start(). After this function returns there will be no more jobs executed by the loop. It is possible to call Start() or Run() again after this to resume the execution. Note, it does not cancel active timeouts.