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 anOk(T)result or any future is ready with anErr(E)result.
- A future that is ready when all futures are ready withSome(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 anOk(T)result.
- A future that is ready when any of the futures is ready andSome(T).
Structs§
- Deadline APP integration.
- Error whenwith_deadlinereach a time limit before a task finishes.
- AWakerthat 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 untilsetis called.
- Represents aFuturerunning in sync with the UI.
Traits§
- Extends rayon’sParallelIteratorwith thread context.
Functions§
- Blocks the thread until thetaskfuture finishes.
- A future that isPendinguntil thedeadlineis reached.
- Executor used in async doc tests.
- Implements aFuturefrom a closure.
- Rayon join with local context.
- Rayon join context with local context.
- Polls thetaskonce immediately on the calling thread, if thetaskis ready returns the response already set, if thetaskis pending continues execution likerespond.
- Polls thetaskonce immediately on the calling thread, if thetaskis pending, continues execution inspawn.
- Spawn a parallel async task that will send its result to aResponseVar<R>.
- Spawn a parallel async task that can also be.awaitfor the task result.
- Likerunbut catches panics.
- Rayon scope with local context.
- Spawn a parallel async task, this function is not blocking and thetaskstarts executing immediately.
- Fire and forget awaittask. Thetaskstarts executing immediately.
- Continuous poll thetaskuntil if finishes.
- Create a paralleltaskthat blocks awaiting for an IO operation, thetaskstarts on the first.await.
- Likewaitbut catches panics.
- Likespawn_wait, but the task will send its result to aResponseVar<R>.
- Add adeadlineto a future.
- A future that isPendingonce and wakes the current task.