rabbitmq / rabbitmq-stream-go-client

A client library for RabbitMQ streams
MIT License
169 stars 20 forks source link

Heartbeat service in v2 #224

Open Zerpet opened 1 year ago

Zerpet commented 1 year ago

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:

We want to reuse this component in multiple places in the codebase. We should implement its own struct to handle all this logic.

Zerpet commented 3 months ago

Some work was done here: https://github.com/rabbitmq/rabbitmq-stream-go-client/blob/heartbeats/pkg/stream/heartbeater.go