pub struct HandlerDeadline { /* private fields */ }Expand description
Per-handler total wall-clock deadline (issue #621), armed against the
same MonotonicClock abstraction the limiter uses. The clear-text
(and TLS) HTTP handler arms one of these at spawn and polls
expired at coarse boundaries (between parse, route
dispatch, and write). Production wires SystemMonotonicClock, so the
deadline tracks real wall time; tests inject a fake clock to drive
expiry deterministically without sleep().
This bounds — but does not pre-empt — handler lifetime: a thread blocked inside a true syscall is still released only by the per-socket read/write timeouts. The deadline reclaims a limiter slot for the internal-lock-contention case the PRD (#569) targets.
Implementations§
Source§impl HandlerDeadline
impl HandlerDeadline
Sourcepub fn arm(clock: Arc<dyn MonotonicClock>, timeout: Duration) -> HandlerDeadline
pub fn arm(clock: Arc<dyn MonotonicClock>, timeout: Duration) -> HandlerDeadline
Arm a deadline timeout from now, read off clock. The clock is
shared (Arc) so the same instance can be reused across handlers.
Trait Implementations§
Source§impl Clone for HandlerDeadline
impl Clone for HandlerDeadline
Source§fn clone(&self) -> HandlerDeadline
fn clone(&self) -> HandlerDeadline
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for HandlerDeadline
impl !RefUnwindSafe for HandlerDeadline
impl Send for HandlerDeadline
impl Sync for HandlerDeadline
impl Unpin for HandlerDeadline
impl UnsafeUnpin for HandlerDeadline
impl !UnwindSafe for HandlerDeadline
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request