Skip to main content

Response

Struct Response 

Source
pub struct Response<A: Application> {
    pub journal_persisted_wire_seq: Arc<AtomicU64>,
    pub durability_mode: Arc<AtomicU8>,
    pub replication_metrics: Option<Arc<ReplicationMetrics>>,
    pub replica_active: Option<[Arc<AtomicBool>; 2]>,
    pub heartbeat_interval: Option<Duration>,
    pub busy_spin: bool,
    pub utilization: Arc<StageUtilization>,
    pub encoder: ResponseEncoderArc<A>,
}
Expand description

Configuration and shared state for the response stage.

Fields§

§journal_persisted_wire_seq: Arc<AtomicU64>

Highest wire seq durably persisted on the primary’s journal. In the same sequence space as OutputSlot.wire_seq and the replica metrics (metrics.in_memory_sequence / metrics.acked_sequence), so the durability gate can compare these values numerically and the comparison is meaningful regardless of starting_sequence (fresh vs recovered primary). Updated by the journal stage after every fsync batch via set_last_seq_publisher.

§durability_mode: Arc<AtomicU8>

Operator-selected durability mode, published through a shared [AtomicU8] so the admin DURABILITY command can swap it at runtime without restarting the node. The response stage reads this once per gate iteration with a relaxed load (cheaper than a Mutex or refcounted Arc<Policy> snapshot) and rebuilds its local Policy when the byte changes. See crate::durability_policy::DurabilityMode::as_u8 for the encoding.

§replication_metrics: Option<Arc<ReplicationMetrics>>

Per-slot replica cursors. None for standalone deployments (no replication wiring) — the policy then evaluates against the primary alone.

§replica_active: Option<[Arc<AtomicBool>; 2]>

Per-slot replica active flags. Only “true” slots are included in the cursor view fed to Policy::evaluate, so disconnected slots don’t pollute the view with stale zero cursors. When the resulting view is too small to satisfy a clause, the policy reports degraded and the gate stalls. Mirrors replication_metricsNone in standalone.

§heartbeat_interval: Option<Duration>§busy_spin: bool§utilization: Arc<StageUtilization>§encoder: ResponseEncoderArc<A>

Wire encoder for application-shaped payloads. Constructed once at boot (Arc::new(ExchangeResponseEncoder)) and shared with the DPDK response stage.

Auto Trait Implementations§

§

impl<A> Freeze for Response<A>

§

impl<A> !RefUnwindSafe for Response<A>

§

impl<A> Send for Response<A>

§

impl<A> Sync for Response<A>

§

impl<A> Unpin for Response<A>

§

impl<A> UnsafeUnpin for Response<A>

§

impl<A> !UnwindSafe for Response<A>

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<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> Same for T

Source§

type Output = T

Should always be Self
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