pitaya icon indicating copy to clipboard operation
pitaya copied to clipboard

How to know when a server in the cluster is shutdown?

Open alubahhh opened this issue 1 year ago • 1 comments

When a server in the cluster is shut down, other servers can receive notifications and handle other operations.

alubahhh avatar Jan 19 '24 05:01 alubahhh

https://github.com/topfreegames/pitaya/blob/cc949c447b0c2dfacb07ff3a8e2c845facaa02b3/cluster/etcd_service_discovery.go#L701-L704

There isn't any public api can do it now, if you actually want, you could implement by yourself according the code above.

bruce1125 avatar Jan 31 '24 03:01 bruce1125

This can actually be implemented using the listeners which is a public API

https://github.com/topfreegames/pitaya/blob/cc949c447b0c2dfacb07ff3a8e2c845facaa02b3/cluster/etcd_service_discovery.go#L230-L247

felipejfc avatar Aug 13 '24 12:08 felipejfc

This can actually be implemented using the listeners which is a public API

https://github.com/topfreegames/pitaya/blob/cc949c447b0c2dfacb07ff3a8e2c845facaa02b3/cluster/etcd_service_discovery.go#L230-L247

That's really great! I nearly made a mistake.😂

bruce1125 avatar Aug 15 '24 02:08 bruce1125