Expand description
Type-safe parallel execution of named async tasks.
Provides a TaskMap for declaring named tasks and an execute_concurrently
entry point that runs them on the tokio runtime with optional cancellation,
timeout, and partial-results modes. Each task runs inside its own tracing
span so it appears as a separate node in distributed traces.
§Example
use altair_concurrent::{execute_concurrently, TaskMap};
let tasks: TaskMap<String> = TaskMap::new()
.insert("greet", |_| async { Ok::<_, std::io::Error>("hi".to_string()) });
let results = execute_concurrently(tasks).await?;
assert_eq!(results["greet"], "hi");Modules§
- prelude
- Common imports for users of this crate.
Structs§
- Cancellation
Token - A token which can be used to signal a cancellation request to one or more tasks.
- Executor
- Fail-fast executor. Constructed by
execute_concurrently. - Join
Error - Task failed to execute to completion.
- JoinSet
- A collection of tasks spawned on a Tokio runtime.
- Partial
Executor - Partial-results executor — every task runs to completion; per-task success/failure exposed in the returned map.
- TaskMap
- A set of named tasks to run concurrently.
Enums§
- Error
- Errors returned by
crate::execute_concurrently.
Functions§
- execute_
concurrently - Run a
TaskMapconcurrently in fail-fast mode.
Type Aliases§
- Boxed
Error - Boxed task error returned in partial-results mode.
- Partial
Results - Per-task result map returned by
PartialExecutor. - Result
- Convenience result alias.