Expand description
NATS client
NatsClient
provided here is a wrapper around [Client
] that provides convenient methods
using domain-specific traits.
Before reading code, make sure to familiarize yourself with NATS documentation, especially with subjects and Core NATS features.
Abstractions provided here cover a few use cases:
- request/response (for example piece request)
- request/stream of responses (for example a stream of plotted sectors of the farmer)
- notifications (typically targeting a particular instance of an app) and corresponding subscriptions (for example solution notification)
- broadcasts and corresponding subscriptions (for example slot info broadcast)
Structs§
- Nats
Client - NATS client wrapper that can be used to interact with other Subspace-specific clients
- Stream
Response Subscriber - Wrapper around subscription that transforms stream of wrapped response messages into a normal
Response
stream. - Subscriber
Wrapper - Subscriber wrapper that decodes messages automatically and skips messages that can’t be decoded
Enums§
- Stream
Request Error - Stream request error
Traits§
- Generic
Broadcast - Generic broadcast message.
- Generic
Notification - Generic one-off notification
- Generic
Request - Generic request with associated response.
- Generic
Stream Request - Generic stream request where response is streamed using
NatsClient::stream_request_responder
.