Skip to main content

PushReplyAwaiter

Struct PushReplyAwaiter 

Source
pub struct PushReplyAwaiter { /* private fields */ }
Expand description

Awaits the correlated reply to a single server-initiated push.

Returned by ConnectionSupervisor::push_to_connection. The reply slot is resolved when the originating connection process receives a PushReply frame carrying the same correlation id, so PushReplyAwaiter::receive blocks (bounded) for that one correlated answer.

Implementations§

Source§

impl PushReplyAwaiter

Source

pub const fn correlation_id(&self) -> u64

Returns the correlation id this awaiter is matched on.

Source

pub fn receive(&self, timeout: Duration) -> Result<Vec<u8>, ServerError>

Blocks up to timeout for the client’s correlated reply payload.

timeout is a WAIT QUANTUM ONLY — a MAXIMUM wait, not a promise to block: an elapsed poll is a benign re-arm, never a failure; the reply’s lifetime belongs to the push. A caller may re-invoke receive indefinitely after a ServerError::PushReplyTimeout: the reserved slot is untouched and a later reply is still delivered byte-exact. The poll quantum never changes the protocol outcome — for a deadlined push the call waits no longer than the EARLIER of the caller’s quantum and the push’s deadline, so the terminal expiry is returned promptly once due, never held until the quantum ends and never deferred past it.

A push with no explicit deadline never touches shared supervisor state here: the elapsed quantum returns straight from the channel wait (behaviour-compatible with 0.2.3 — no registry lock, no contention, no poison exposure on the unchanged API).

§Errors

Returns ServerError::PushReplyTimeout when no reply arrived within this timeout quantum and the push’s deadline (if any) is not yet due (a benign re-arm — call again to keep waiting); ServerError::PushReplyExpired when the push carried an explicit reply deadline (via push_to_connection_with_deadline) and that deadline is due (terminal: the slot is removed and its §5 cap admission released; returned as soon as the deadline passes, even mid-quantum — but evaluated at observation points, not against the wall clock: a reply already delivered when this call observes the slot wins over expiry, even if it arrived after the deadline instant); or ServerError::PushReplyDisconnected when the connection process dropped the reply slot (the connection closed — the prompt worker-death signal). The variants are distinct so callers classify by type, not message.

Trait Implementations§

Source§

impl Debug for PushReplyAwaiter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more