NATS C Client with JetStream and Streaming support  3.2.0
The C Client, Supported by Synadia Communications Inc.


 JetStream Assets Management


NATS_EXTERN natsStatus jsOptions_Init (jsOptions *opts)
 Initializes a streaming context options structure. More...
NATS_EXTERN natsStatus natsConnection_JetStream (jsCtx **js, natsConnection *nc, jsOptions *opts)
 Returns a new JetStream context. More...
NATS_EXTERN void jsCtx_Destroy (jsCtx *js)
 Destroys the JetStream context. More...

Detailed Description


Function Documentation

◆ jsOptions_Init()

NATS_EXTERN natsStatus jsOptions_Init ( jsOptions opts)

Use this before setting specific stream context options and passing it to JetStream APIs.

optsthe pointer to the jsOptions to initialize.

◆ natsConnection_JetStream()

NATS_EXTERN natsStatus natsConnection_JetStream ( jsCtx **  js,
natsConnection nc,
jsOptions opts 

A JetStream context is used for messaging and assets management.

Since the underlying NATS connection is used for communication, the NATS connection should stay valid while using the JetStream context. That is, do not close/destroy the NATS connection before destroying the JetStream context.

When done, the context should be destroyed to release memory.
jsthe location where to store the pointer to the newly created jsCtx object.
ncthe pointer to the natsConnection object from which to get the JetStream context.
optsthe pointer to the jsOptions object, possibly NULL.

◆ jsCtx_Destroy()

NATS_EXTERN void jsCtx_Destroy ( jsCtx js)

Releases memory used by the context object.

jsthe pointer to the jsCtx object to destroy.