Crate zng_task

Source
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§

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 an Err(E) result.
  • A future that is ready when all futures are ready with Some(T) or when any is future ready with None.
  • 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§

Traits§

Functions§

  • Blocks the thread until the task future finishes.
  • A future that is Pending until the deadline is reached.
  • Executor used in async doc tests.
  • Implements a Future from a closure.
  • Rayon join with local context.
  • Rayon join context with local context.
  • Polls the task once immediately on the calling thread, if the task is ready returns the response already set, if the task is pending continues execution like respond.
  • Polls the task once immediately on the calling thread, if the task is pending, continues execution in spawn.
  • Spawn a parallel async task that will send its result to a ResponseVar<R>.
  • Spawn a parallel async task that can also be .await for the task result.
  • Like run but catches panics.
  • Rayon scope with local context.
  • Spawn a parallel async task, this function is not blocking and the task starts executing immediately.
  • Fire and forget a wait task. The task starts executing immediately.
  • Continuous poll the task until if finishes.
  • Create a parallel task that blocks awaiting for an IO operation, the task starts on the first .await.
  • Like wait but catches panics.
  • Like spawn_wait, but the task will send its result to a ResponseVar<R>.
  • Add a deadline to a future.
  • A future that is Pending once and wakes the current task.