You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any option to set the closing callback for a node client in ClusterClient?
Use Case
I want to start metrics collection process on every new node client creation and stop it when the node client is removed for some reason. To stop the process I have to provide a callback somehow. To start the process I can use ClusterClient.OnNewNode.
Ideas
One solution that comes to my mind is to add a callback to the return function that the ClusterClient.OnNewNode accepts:
Good day!
Is there any option to set the closing callback for a node client in ClusterClient?
Use Case
I want to start metrics collection process on every new node client creation and stop it when the node client is removed for some reason. To stop the process I have to provide a callback somehow. To start the process I can use
ClusterClient.OnNewNode
.Ideas
One solution that comes to my mind is to add a callback to the return function that the
ClusterClient.OnNewNode
accepts:This callback should be added to the
clusterNode
and called inside it'sClose
method.However, to avoid breaking backward compatibility, it's possible to add a separate method for
ClusterClient
, such asOnNewNodeWithClose
.Another idea is to expand the
redis.Hook
interface to provide additionalCloseHook
method.Thanks for any feedback in advance.
The text was updated successfully, but these errors were encountered: