async_nats::jetstream

Function new

Source
pub fn new(client: Client) -> Context
Expand description

Creates a new JetStream Context that provides JetStream API for managing and using Streams, Consumers, key value and object store.

ยงExamples


let client = async_nats::connect("localhost:4222").await?;
let jetstream = async_nats::jetstream::new(client);

jetstream.publish("subject", "data".into()).await?;