async_nats::jetstreamFunction with_domain
source pub fn with_domain<T: AsRef<str>>(client: Client, domain: T) -> Context
Expand description
Creates a new JetStream Context with given JetStream domain.
ยงExamples
let client = async_nats::connect("localhost:4222").await?;
let jetstream = async_nats::jetstream::with_domain(client, "hub");
jetstream.publish("subject", "data".into()).await?;