Skip to main content

Module threads

Module threads 

Source
Expand description

IO-threads based module to support shared behavior with task based version.

Modules§

mpsc
non-async replacement for mpsc channels
oneshot
non-async replacement for oneshot channels

Structs§

CancellationToken
A token that can be used to signal cancellation.
JoinHandle
An owned permission to join on a thread (block on its termination).

Traits§

Future
A future represents an asynchronous computation, commonly obtained by use of async.

Functions§

block_on
Create a temporary tokio runtime and block on the given future.
ctrl_c
Returns a closure that blocks until Ctrl+C is received.
run
Initialize tracing and run the given function.
sleep
Puts the current thread to sleep for at least the specified amount of time.
spawn
Spawns a new thread, returning a JoinHandle for it.
spawn_blocking
Spawn blocking is the same as spawn for pure threaded usage.