Skip to main content

Crate bluetape_rs_async

Crate bluetape_rs_async 

Source
Expand description

Tokio-first helpers for bounded async task execution.

The helpers in this crate make task lifecycle policy explicit: callers choose between first-error execution with sibling cancellation, collect-all execution that records every operation result, and small cancellation or timeout wrappers built directly on Tokio primitives.

use bluetape_rs_async::try_map_bounded;

let values = try_map_bounded([1, 2, 3], 2, |value| async move {
    Ok::<_, &'static str>(value * 2)
})
.await?;

assert_eq!(values, vec![2, 4, 6]);

Structs§

CancellationSource
Handle used to request cancellation for one or more CancellationTokens.
CancellationToken
Receiver-side cancellation token.
ShutdownSignal
Listener side of a shutdown signal pair.
ShutdownTrigger
Trigger side of a shutdown signal pair.
TaskFailure
A failed operation result captured by map_bounded_collect.
TaskGroupReport
Operation results captured by map_bounded_collect.
TaskSuccess
A successful operation result captured by map_bounded_collect.

Enums§

AsyncControlError
Error returned by timeout, deadline, cancellation, and shutdown helpers.
TaskGroupError
Error returned by bounded task helpers.

Constants§

DEFAULT_MAX_CONCURRENCY
Default concurrency bound for callers that do not need a custom limit.
MAX_CONCURRENCY
Maximum accepted concurrency bound.

Functions§

map_bounded_collect
Runs operations with bounded concurrency and records every operation result.
run_until_cancelled
Runs a future until either it completes or cancellation is requested.
shutdown_signal
Creates a shutdown trigger and its first listener.
try_map_bounded
Runs operations with a bounded number of Tokio tasks.
with_deadline
Runs a future until a Tokio deadline.
with_timeout
Runs a future with a Tokio timeout.
with_timeout_or_cancel
Runs a future until it completes, times out, or cancellation is requested.