Module scope

Source
Expand description

Structured concurrency API for fuchsia-async.

See the Scope documentation for details.

Structs§

Join
Join operation for a Scope.
Scope
A scope for managing async tasks. This scope is cancelled when dropped.
ScopeHandle
A handle to a scope, which may be used to spawn tasks.
ScopeStream
Similar to a scope but all futures spawned on the scope must finish with the same result type. That allows the scope to return a stream of results. Attempting to spawn tasks using ScopeHandle::spawn (or similar) will result in tasks that are immediately dropped (just as if the scope was closed). Like a regular scope, the scope can be closed, at which point the stream will terminate once all the tasks have finished. This is designed to be a fairly close drop-in replacement to FuturesUnordered, the principle difference being that the tasks run in parallel rather than just concurrently. Another difference is that the futures don’t need to be the same type; only the outputs do. In all other respects, the scope operates like a regular scope i.e. it can have children, you can join them, cancel them, etc.

Traits§

Spawnable
Trait for things that can be spawned on to a scope. There is a blanket implementation below for futures.