Expand description
Parallel async tasks and async task runners.
§Crate
This crate is part of the zng project.
§Cargo Features
This crate provides 4 feature flags, 0 enabled by default.
§"deadlock_detection"
Enables parking_lot deadlock detection.
§"ipc"
Enables ipc tasks.
Only enables in cfg(not(any(target_os = "android", target_arch = "wasm32"))) builds.
§"http"
Enables http tasks.
§"test_util"
Enabled by doc tests.
Re-exports§
pub use parking_lot;pub use rayon;
Modules§
- Async channels.
- Async filesystem primitives.
- HTTP client.
- IO tasks.
- IPC tasks.
Macros§
- A future that zips other futures.
- A future that is ready when all futures are ready with an
Ok(T)result or any future is ready with anErr(E)result. - A future that is ready when all futures are ready with
Some(T)or when any is future ready withNone. - A future that awaits for the first future that is ready.
- A future that waits for the first future that is ready with an
Ok(T)result. - A future that is ready when any of the futures is ready and
Some(T).
Structs§
- Deadline APP integration.
- Error when
with_deadlinereach a time limit before a task finishes. - A
Wakerthat dispatches a wake call to multiple other wakers. - Parallel iterator adapter the propagates the thread context.
- Represents a fork-join scope which can be used to spawn any number of tasks that run in the caller’s thread context.
- A future that will await until
setis called. - Represents a
Futurerunning in sync with the UI.
Traits§
- Extends rayon’s
ParallelIteratorwith thread context.
Functions§
- Blocks the thread until the
taskfuture finishes. - A future that is
Pendinguntil thedeadlineis reached. - Executor used in async doc tests.
- Implements a
Futurefrom a closure. - Rayon join with local context.
- Rayon join context with local context.
- Polls the
taskonce immediately on the calling thread, if thetaskis ready returns the response already set, if thetaskis pending continues execution likerespond. - Polls the
taskonce immediately on the calling thread, if thetaskis pending, continues execution inspawn. - Spawn a parallel async task that will send its result to a
ResponseVar<R>. - Spawn a parallel async task that can also be
.awaitfor the task result. - Like
runbut catches panics. - Rayon scope with local context.
- Spawn a parallel async task, this function is not blocking and the
taskstarts executing immediately. - Fire and forget a
waittask. Thetaskstarts executing immediately. - Continuous poll the
taskuntil if finishes. - Create a parallel
taskthat blocks awaiting for an IO operation, thetaskstarts on the first.await. - Like
waitbut catches panics. - Like
spawn_wait, but the task will send its result to aResponseVar<R>. - Add a
deadlineto a future. - A future that is
Pendingonce and wakes the current task.