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", target_os = "ios"))) builds.
§"http"
Enables http tasks.
§"test_util"
Enabled by doc tests.
Re-exports§
pub use parking_lot;pub use rayon;
Modules§
Macros§
- all
- A future that zips other futures.
- all_ok
- A future that is ready when all futures are ready with an
Ok(T)result or any future is ready with anErr(E)result. - all_
some - A future that is ready when all futures are ready with
Some(T)or when any is future ready withNone. - any
- A future that awaits for the first future that is ready.
- any_ok
- A future that waits for the first future that is ready with an
Ok(T)result. - any_
some - A future that is ready when any of the futures is ready and
Some(T).
Structs§
- DEADLINE_
APP - Deadline APP integration.
- Deadline
Error - Error when
with_deadlinereach a time limit before a task finishes. - McWaker
- A
Wakerthat dispatches a wake call to multiple other wakers. - Parallel
Iterator With Ctx - Parallel iterator adapter the propagates the thread context.
- Progress
- Status update about a task progress.
- Scope
Ctx - Represents a fork-join scope which can be used to spawn any number of tasks that run in the caller’s thread context.
- Signal
Once - A future that will await until
setis called. - UiTask
- Represents a
Futurerunning in sync with the UI.
Traits§
- Parallel
Iterator Ext - Extends rayon’s
ParallelIteratorwith thread context.
Functions§
- all
- A future that awaits on all
futuresat the same time and returns all results when all futures are ready. - all_ok
- A future that awaits on all
futuresat the same time and returns when all futures areOk(_)or any future isErr(_). - all_
some - A future that awaits on all
futuresat the same time and returns when all futures areSome(_)or any future isNone. - any
- A future that awaits on all
futuresat the same time and returns the first result when the first future is ready. - any_ok
- A future that awaits on all
futuresat the same time and returns when any future isOk(_)or all areErr(_). - any_
some - A future that awaits on all
futuresat the same time and returns when any future isSome(_)or all areNone. - block_
on - Blocks the thread until the
taskfuture finishes. - deadline
- A future that is
Pendinguntil thedeadlineis reached. - doc_
test - Executor used in async doc tests.
- future_
fn - Implements a
Futurefrom a closure. - join
- Rayon join with local context.
- join_
context - Rayon join context with local context.
- poll_
respond - Polls the
taskonce immediately on the calling thread, if thetaskis ready returns the response already set, if thetaskis pending continues execution likerespond. - poll_
spawn - Polls the
taskonce immediately on the calling thread, if thetaskis pending, continues execution inspawn. - respond
- Spawn a parallel async task that will send its result to a
ResponseVar<R>. - run
- Spawn a parallel async task that can also be
.awaitfor the task result. - run_
catch - Like
runbut catches panics. - scope
- Rayon scope with local context.
- spawn
- Spawn a parallel async task, this function is not blocking and the
taskstarts executing immediately. - spawn_
wait - Fire and forget a
waittask. Thetaskstarts executing immediately. - spin_on
- Continuous poll the
taskuntil if finishes. - wait
- Create a parallel
taskthat blocks awaiting for an IO operation, thetaskstarts on the first.await. - wait_
catch - Like
waitbut catches panics. - wait_
respond - Like
spawn_wait, but the task will send its result to aResponseVar<R>. - with_
deadline - Add a
deadlineto a future. - yield_
now - A future that is
Pendingonce and wakes the current task.