Skip to main content

Module gate

Module gate 

Source
Expand description

Graceful shutdown gate primitive.

The design is inspired by axum’s server handle pattern (https://github.com/tokio-rs/axum): a sticky shutdown signal, tracked in-flight work, and a graceful drain phase before forced shutdown. This module is not tied to HTTP; it lifts that operational shape into a small runtime primitive that any service loop can use.

Structs§

Gate
Permit

Enums§

Error
Why a Gate refused a permit.
GateDrainOutcome
Result of waiting for accepted work to leave a Gate.

Functions§

create_gate
Create a gate that automatically initiates graceful shutdown when the token is cancelled.
default_acquire_timeout