async_nats::jetstreamFunction with_prefix
Source pub fn with_prefix(client: Client, prefix: &str) -> Context
Expand description
Creates a new JetStream Context with given JetStream prefix.
By default it is $JS.API
.
ยงExamples
let client = async_nats::connect("localhost:4222").await?;
let jetstream = async_nats::jetstream::with_prefix(client, "JS.acc@hub.API");
jetstream.publish("subject", "data".into()).await?;