NATS C Client with JetStream and Streaming support
3.9.1
The nats.io C Client, Supported by Synadia Communications Inc.
|
Typedefs | |
typedef microError *(* | microRequestHandler) (microRequest *req) |
Callback type for request processing. More... | |
typedef void(* | microErrorHandler) (microService *m, microEndpoint *ep, natsStatus s) |
Callback type for async error notifications. More... | |
typedef void(* | microDoneHandler) (microService *m) |
Callback type for Done (service stopped) notifications. More... | |
Microservice callbacks.
typedef microError*(* microRequestHandler) (microRequest *req) |
This is the callback that one provides when creating a microservice endpoint. The library will invoke this callback for each message arriving to the specified subject.
req | The request object, containing the message and other relevant references. |
typedef void(* microErrorHandler) (microService *m, microEndpoint *ep, natsStatus s) |
If specified in microServiceConfig, this callback is invoked for internal errors (e.g. message delivery failures) related to a microservice. If the error is associated with an endpoint, the ep parameter points at the endpoint. However, this handler may be invoked for errors happening in monitoring subjects, in which case ep is NULL.
The error handler is invoked asynchronously, in a separate theread.
The error handler is not invoked for microservice-level errors that are sent back to the client as responses. Note that the error counts in microEndpointStats include both internal and service-level errors.
m | The microservice object. |
ep | The endpoint object, or NULL if the error is not associated with an endpoint. |
s | The NATS status for the error. |
typedef void(* microDoneHandler) (microService *m) |
If specified in microServiceConfig, this callback is invoked right after the service stops. In the C client, this callback is invoked directly from the microService_Stop function, in whatever thread is executing it.
m | The microservice object. |