NATS C Client with JetStream and Streaming support: JetStream

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

Loading...
Searching...
No Matches
Modules | Functions
JetStream
Functions

## Modules
| JetStream Assets Management
| Publishing
| Subscribing
| Messages

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

## Detailed Description

JetStream.

## 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.

Parameters

  opts | the 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.

Note
  When done, the context should be destroyed to release memory.

Parameters

  js | the location where to store the pointer to the newly created jsCtx object.
  nc | the pointer to the natsConnection object from which to get the JetStream context.
  opts | the pointer to the jsOptions object, possibly `NULL`.

## ◆ jsCtx_Destroy()

NATS_EXTERN void jsCtx_Destroy | ( | jsCtx * | js | ) |

Releases memory used by the context object.

Parameters

  js | the pointer to the jsCtx object to destroy.