Atom

task module

Resume coroutines, start background work, and communicate over channels.

Import it with 'use task'.

Atom
use task
func job():
    yield 'ready'

handle = create(coroutine, job)
print(task.resume(handle))
Output
ready

The coroutine operations resume, cancel and status are always present. Worker, timer, I/O and channel operations require libuv. Durations accept finite nonnegative numbers in seconds. Optional wait timeouts treat null as unlimited and zero as an immediate check, subject to platform scheduling.

Functions