|
NATS_EXTERN microError * | micro_AddService (microService **new_microservice, natsConnection *nc, microServiceConfig *config) |
| Creates and starts a new microservice. More...
|
|
NATS_EXTERN microError * | microService_AddEndpoint (microService *m, microEndpointConfig *config) |
| Adds an endpoint to a microservice and starts listening for messages. More...
|
|
NATS_EXTERN microError * | microService_AddGroup (microGroup **new_group, microService *m, microGroupConfig *config) |
| Adds an group (prefix) to a microservice. More...
|
|
NATS_EXTERN microError * | microService_Destroy (microService *m) |
| Destroys a microservice, stopping it first if needed. More...
|
|
NATS_EXTERN natsConnection * | microService_GetConnection (microService *m) |
| Returns the connection associated with the service. If the service was successfully started, it is safe to assume it's not NULL, however it may already have been disconnected or closed. More...
|
|
NATS_EXTERN microError * | microService_GetInfo (microServiceInfo **new_info, microService *m) |
| Returns a microServiceInfo for a microservice. More...
|
|
NATS_EXTERN void * | microService_GetState (microService *m) |
| Returns the pointer to state data (closure). It is originally provided in microServiceConfig.State. More...
|
|
NATS_EXTERN microError * | microService_GetStats (microServiceStats **new_stats, microService *m) |
| Returns run-time statistics for a microservice. More...
|
|
NATS_EXTERN bool | microService_IsStopped (microService *m) |
| Checks if the service is stopped. More...
|
|
NATS_EXTERN microError * | microService_Run (microService *m) |
| Waits for a microservice to stop. More...
|
|
NATS_EXTERN microError * | microService_Stop (microService *m) |
| Stops a running microservice. More...
|
|
Functions that operate with microService.
◆ micro_AddService()
◆ microService_AddEndpoint()
◆ microService_AddGroup()
◆ microService_Destroy()
◆ microService_GetConnection()
◆ microService_GetInfo()
◆ microService_GetState()
◆ microService_GetStats()
◆ microService_IsStopped()
◆ microService_Run()
◆ microService_Stop()
Drains and closes the all subscriptions (endpoints and monitoring), resets the stats, and calls the Done
callback for the service, so it can do its own clean up if needed.
It is possible that this call encounters an error while stopping the service, in which case it aborts and returns the error. The service then may be in a partially stopped state, and the Done
callback will not have been called.
- Parameters
-
- Returns
- a microError if an error occurred.
- See also
- micro_AddService, microService_Run