class Scope

The scope a Task.scope block is given: the tasks started with #spawn are waited for when the block ends.

<prelude>:5896

Methods

def spawn[T](&: () -> T) -> Task[T]

Starts a task in the scope running the block, as Task.spawn does, and returns it.

Task.scope waits for it before it returns.

<prelude>:5903

def cancel -> Void

Cancels the scope's tasks (Task#cancel); Task.scope then waits for them and returns the block's value normally.

<prelude>:5906