Home

Awaits.jl

Awaits.AwaitsModule.

Awaits: [WIP] Structured concurrency for parallel computing

Dev Build Status Codecov Coveralls GitHub last commit

source
Awaits.cancel!Method.
cancel!(context::TaskContext)

Cancel (stop) execution of task context.

source
Awaits.@awaitMacro.
@await body

Handle an exception returned from body. If body evaluates to an Exception, it cancels all the tasks attached to the current context.

The variable _ in code like @await f(_, x, y) is replaced by the current task context. It must be invoked inside @taskgroup or @in macros.

source
@cancelscope(body) :: TaskContext

Create a task context with a new scope of cancellation. Tasks launched inside a @cancelscope can be cancelled independently from the tasks outside to this scope. This scope returns a context object that can be used to cancel the task by calling cancel! on this object.

source
Awaits.@checkMacro.
@check [context]

Check context and exit the function (do return Cancelled()) if it is required.

source
Awaits.@goMacro.
@go body

A wrapper of Threads.@spawn that makes cancellation work.

The variable _ in code like @go f(_, x, y) is replaced by the current task context. It must be invoked inside @taskgroup or @in macros.

source
Awaits.@inMacro.
@in context body

Enter into the task context so that other macros like @go works as expected. This should be used inside a function in which the task context is passed by a caller (for example, using @go f(_) macro).

source
@taskgroup(body)

Create a new task context. This is an extension of the @sync block.

source