Skip to main content

Crate curfew

Crate curfew 

Source
Expand description

curfew provides a deadline-aware fork-join abstraction for Rust.

The crate exposes two primary building blocks:

  • DeadlineJoiner to manage groups of threads and collect only those completing before an absolute Instant deadline.
  • join_with_deadline to attempt joining an individual JoinHandle before a deadline while still allowing late results to be recovered.
  • Enable the tokio feature to unlock async counterparts (DeadlineJoinerAsync and join_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§

DeadlineJoiner
Coordinates a set of background tasks and collects the results that finish before a deadline.
DeadlineSummary
Summary produced by DeadlineJoiner::join_ready.
LateTask
Handle that allows recovering the result of a task that exceeded the deadline.
PanicInfo
Captured information about a panic.
TaskResult
Metadata about a task that completed before the deadline.
TimedOutTask
Metadata describing a task that did not complete before the deadline.

Enums§

JoinOutcome
Result wrapper returned by join_with_deadline.
TaskOutcome
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.