Rust

consumer

Module

Streams, consumers and the messages they deliver.

Contents

use utopia_nats::jetstream::consumer::Consumer;
Rust
pub struct Consumer

A pull consumer.

use utopia_nats::jetstream::consumer::JetStreamMessage;
Rust
pub struct JetStreamMessage

A message delivered by a JetStream consumer, to acknowledge.

use utopia_nats::jetstream::consumer::MessageBatch;
Rust
pub struct MessageBatch

The messages one pull returned.

Also implements IntoIterator.
use utopia_nats::jetstream::consumer::OrderedConsumer;
Rust
pub struct OrderedConsumer

An ordered consumer: an ephemeral push consumer with flow control and heartbeats, delivering in order, and recreated from the next stream sequence when a gap shows.

use utopia_nats::jetstream::consumer::PushSubscription;
Rust
pub struct PushSubscription

A push consumer's subscription: data messages go to the callback, flow-control requests are answered and heartbeats swallowed. Drive it with Connection::wait or Connection::process_message.

use utopia_nats::jetstream::consumer::Stream;
Rust
pub struct Stream

A stream, with the info it was fetched with.

use utopia_nats::jetstream::consumer::AckKind;
Rust
pub enum AckKind

How a JetStream message is answered.

Rust
pub type PushCallback = Box<dyn FnMut(JetStreamMessage) -> Result<(), CallbackError> + Send>

A callback receiving the messages of a push consumer.