spawn_local
function · ferroui-system · v0.5.0
fn spawn_local<F>(future: F) -> super::join::JoinHandle<<F as >::Output>
where F: Future + 'static,
<F as >::Output: 'static
Runs future as a task of the current thread, in the queue of the thread, and gives its
handle. The future is polled at once, up to its first pending await, and again whenever it is
woken: at once on this thread (inside the call that wakes it, or right after its own poll when
the wake comes from inside it), and when the thread runs run_pending for a wake from
another thread (the module's documentation).
Spawned in the work of a schedule (current_schedule: a dispatcher job), the task takes that
schedule instead: a wake on this thread while the same schedule is current (a job of the same
dispatcher and priority) polls it at once, as above; any other wake, from this thread or
another, queues one poll on the schedule (a job at that priority). This is the rule of await
in .NET, which runs a continuation inline when the completing code runs in the captured
SynchronizationContext and posts it there otherwise.
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.