rabbitmq-stream-go-client
rabbitmq-stream-go-client copied to clipboard
Heartbeat service in v2
Summary
Implement a mechanism to receive and send heartbeats. Heartbeats should be sent when there are inactivity periods, for example, when the client is inactive (no locator operations) for some time. It should reset the timer when there's a locator operation.
More context
We want to implement a component that encapsulates the heartbeat behaviour. This component should:
- waits on a
time.Ticker
to send heartbeats to the server - responds to heartbeats from the rabbitmq server
- resets the ticker when there is a locator operation, a producer operation or a consumer operation
We want to reuse this component in multiple places in the codebase. We should implement its own struct to handle all this logic.