Skip to main content

ConsumeResponse

Struct ConsumeResponse 

Source
pub struct ConsumeResponse {
    pub events: Vec<StoredEvent>,
    pub next_id: Option<String>,
    pub has_more: bool,
    pub truncated_at_per_shard_cap: bool,
    pub stalled_shards: Vec<u16>,
    pub failed_shards: Vec<u16>,
}
Expand description

Response from consuming events.

Fields§

§events: Vec<StoredEvent>

Events matching the request.

§next_id: Option<String>

Cursor for the next poll. None if no events returned.

§has_more: bool

True if there are more events available.

§truncated_at_per_shard_cap: bool

true if the per-shard fetch was clamped by the internal PER_SHARD_FETCH_CAP (10 000). Callers requesting very large limit values across few shards may receive fewer events than limit per poll() even when the underlying streams have more — pagination via next_id still works.

Pre-fix this clamp was silent. The default is false; tools building observability around large polls can detect under-delivery via this flag.

§stalled_shards: Vec<u16>

Shards that reported has_more=true but contributed no events and no cursor advance to this poll. The merger suppresses the aggregate has_more flag for caller- protection (preventing infinite loops), but operators monitoring adapter health should know which shards are stuck.

Pre-fix the suppression was logged at warn but invisible to callers. Empty on the happy path; populated only when a stall was detected and suppressed.

§failed_shards: Vec<u16>

Shards whose adapter call returned an error during this poll. The merger logs each error at WARN and continues with the surviving shards, so the response’s events can come from a strict subset of the configured shards and silently miss data the operator expected to see. Operators monitoring adapter health need to know WHICH shards failed (not just that something logged a warn) so they can correlate alerts with specific Redis / JetStream nodes.

Pre-fix this signal lived only in the warn log; an observer parsing ConsumeResponse saw a clean partial- shards response with no field indicating which shards were missing, in contrast to stalled_shards which IS surfaced. Empty on the happy path; populated only when at least one shard’s poll errored.

Recovery-latency note: when a previously-failed shard returns to health, its backlog drains at the per-shard limit of the next poll (limit / shards.len() * over_fetch_factor). A 4-shard poll where one shard was down for 60 s and the others kept ingesting can take several normal-cadence polls to fully drain the recovered shard. No backlog-size hint is surfaced on the response; callers that need to detect a stuck-recovery condition should monitor cursor advance per shard across consecutive polls.

Implementations§

Source§

impl ConsumeResponse

Source

pub fn empty() -> Self

Create an empty response.

Trait Implementations§

Source§

impl Clone for ConsumeResponse

Source§

fn clone(&self) -> ConsumeResponse

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConsumeResponse

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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