Expand description
curfew provides a deadline-aware fork-join abstraction for Rust.
The crate exposes two primary building blocks:
DeadlineJoinerto manage groups of threads and collect only those completing before an absoluteInstantdeadline.join_with_deadlineto attempt joining an individualJoinHandlebefore a deadline while still allowing late results to be recovered.- Enable the
tokiofeature to unlock async counterparts (DeadlineJoinerAsyncandjoin_with_deadline_async) with matching semantics.
All utilities operate entirely in safe Rust and gracefully skip work that runs past the deadline without attempting to cancel or terminate threads.
Structs§
- Deadline
Joiner - Coordinates a set of background tasks and collects the results that finish before a deadline.
- Deadline
Summary - Summary produced by
DeadlineJoiner::join_ready. - Late
Task - Handle that allows recovering the result of a task that exceeded the deadline.
- Panic
Info - Captured information about a panic.
- Task
Result - Metadata about a task that completed before the deadline.
- Timed
OutTask - Metadata describing a task that did not complete before the deadline.
Enums§
- Join
Outcome - Result wrapper returned by
join_with_deadline. - Task
Outcome - Outcome of executing a task.
Functions§
- join_
with_ deadline - Attempts to join a thread before a deadline, returning late results via
LateTask.
Type Aliases§
- TaskId
- Identifier assigned to each task managed by
curfew.