Skip to main content

Module task

Module task 

Source

Functionsยง

block_on
Blocks the current thread until the provided future has completed.
dispatch
Spawns a new asynchronous task in the background without a handle. Basically the same as spawn.
executor_scope
Run an async closure with a scoped Executor wrapper that forwards spawns to this executor, waits for all spawned tasks to finish when the closure returns, and aborts any outstanding tasks if the scope future itself is cancelled.
runtime_type
Returns an optional runtime name of the executor.
scope
Create a structured-concurrency scope in which tasks may be spawned that borrow from the enclosing stack frame.
spawn
Spawns a new asynchronous task in the background, returning a Future JoinHandle for it.
spawn_abortable
Spawns a new asynchronous task in the background, returning an abortable handle that will cancel the task once the handle is dropped.
spawn_abortable_delay
Spawns a task after waiting for a duration before the task is polled.
spawn_abortable_timeout
Spawns a new asynchronous task, returning an abortable handle, that must complete within duration.
spawn_blocking
spawn_coroutine
Spawns a new asynchronous task that accepts messages to the task. This function returns a handle that allows sending a message, or if there is no reference to the handle at all (in other words, all handles are dropped), the task would be aborted.
spawn_coroutine_with_buffer
Spawns a new asynchronous task that accepts messages to the task with a set buffer. This function returns a handle that allows sending a message, or if there is no reference to the handle at all (in other words, all handles are dropped), the task would be aborted.
spawn_coroutine_with_buffer_and_context
Spawns a new asynchronous task with provided context that accepts messages to the task with a set buffer. This function returns a handle that allows sending a message, or if there is no reference to the handle at all (in other words, all handles are dropped), the task would be aborted.
spawn_coroutine_with_context
Spawns a new asynchronous task with provided context that accepts messages to the task. This function returns a handle that allows sending a message, or if there is no reference to the handle at all (in other words, all handles are dropped), the task would be aborted.
spawn_coroutine_with_receiver
Spawns a new asynchronous task that accepts messages to the task using channels. This function returns a handle that allows sending a message, or if there is no reference to the handle at all (in other words, all handles are dropped), the task would be aborted.
spawn_coroutine_with_receiver_and_buffer
Spawns a new asynchronous task with a set channel buffer that accepts messages to the task using channels. This function returns a handle that allows sending a message, or if there is no reference to the handle at all (in other words, all handles are dropped), the task would be aborted.
spawn_coroutine_with_receiver_and_context
Spawns a new asynchronous task with provided context that accepts messages to the task using channels. This function returns a handle that allows sending a message, or if there is no reference to the handle at all (in other words, all handles are dropped), the task would be aborted.
spawn_coroutine_with_receiver_buffer_and_context
Spawns a new asynchronous task with a set channel buffer and provided context that accepts messages to the task using channels. This function returns a handle that allows sending a message, or if there is no reference to the handle at all (in other words, all handles are dropped), the task would be aborted.
spawn_delay
Spawns a task after waiting for a duration before the task is polled.
spawn_timeout
Spawns a new asynchronous task that must complete within duration.
spawn_unbounded_coroutine
Spawns a new asynchronous task that accepts unbounded messages to the task. This function returns a handle that allows sending a message, or if there is no reference to the handle at all (in other words, all handles are dropped), the task would be aborted.
spawn_unbounded_coroutine_with_context
Spawns a new asynchronous task with provided context that accepts unbounded messages to the task. This function returns a handle that allows sending a message, or if there is no reference to the handle at all (in other words, all handles are dropped), the task would be aborted.
spawn_unbounded_coroutine_with_receiver
Spawns a new asynchronous task that accepts messages to the task using channels. This function returns a handle that allows sending a message, or if there is no reference to the handle at all (in other words, all handles are dropped), the task would be aborted.
spawn_unbounded_coroutine_with_receiver_and_context
Spawns a new asynchronous task with provided context that accepts messages to the task using channels. This function returns a handle that allows sending a message, or if there is no reference to the handle at all (in other words, all handles are dropped), the task would be aborted.
yield_for
Yields execution back to the runtime amount times.
yield_now
Yields execution back to the runtime