Module loop

Types

LoopExecutor* = ref object
  uvIdler: ptr uv_idle_t
  callback*: proc ()
  enabled: bool
  Source Edit
LoopExecutorWithArg*[T] = ref object
  callback*: proc (t: T)
  arg*: T
  executor: LoopExecutor
  Source Edit

Procs

proc disable*(self: LoopExecutor)
  Source Edit
proc enable*(self: LoopExecutor)
  Source Edit
proc newLoopExecutor*(): LoopExecutor
  Source Edit
proc runLoop*()
  Source Edit
proc runLoopOnce*(): bool
  Source Edit
proc stopLoop*()
  Source Edit
proc disableFdInheritance*()
  Source Edit
proc addSignalHandler*(signal: cint; callback: proc ())
  Source Edit
proc enableGcNoDelay*()
Enable garbage collection during after event loop tick.   Source Edit
proc enable*(self: LoopExecutorWithArg)
  Source Edit
proc newLoopExecutorWithArg*[T](): LoopExecutorWithArg[T]
  Source Edit
proc initThreadLoop*()

Initializes the event loop for this thread.

Call destroyThreadLoop before returning from the thread to avoid memory leak.

  Source Edit
proc destroyThreadLoop*()
Destroys the event loop for this thread.   Source Edit
proc callSoon*(p: proc ())
  Source Edit