socket.io-adapter
socket.io-adapter copied to clipboard
Add option to fetchSockets that returns results even if some nodes didn't respond
Hey there,
the current implementation of fetchSockets
in ClusterAdapterWithHeartbeat
only resolves if a response was received from all cluster nodes. In some situations this isn't needed and an optimistic response would suffice (i.e. return all responses of nodes that are alive).
Two options I can think of to do this would be to add an optional optimistic flag to the fetchSockets
method or add it as parameter to the cluster config. The value would default to false for backwards compatibility. I can open a PR and implement it if you don't see any issues with this.