jetstream-extra 0.1.0

Set of utilities and extensions for the JetStream NATS of the async-nats crate
Documentation

JetStream extensions for async-nats.

This crate provides additional functionality for NATS JetStream that extends the capabilities of the async-nats client.

Features

Batch Publishing

The [batch_publish] module provides atomic batch publishing capabilities:

# use jetstream_extra::batch_publish::BatchPublishExt;
# async fn example(client: impl BatchPublishExt) -> Result<(), Box<dyn std::error::Error>> {
// Publish multiple messages as an atomic batch
let mut batch = client.batch_publish().build();
batch.add("events.1", "data1".into()).await?;
batch.add("events.2", "data2".into()).await?;
let ack = batch.commit("events.3", "final".into()).await?;
# Ok(())
# }

See the [batch_publish] module for detailed documentation.