serfclient-py icon indicating copy to clipboard operation
serfclient-py copied to clipboard

Add stream/stop support

Open wkornewald opened this issue 11 years ago • 3 comments

Could you please add support for streaming events, so it's possible to watch for e.g. member updates?

wkornewald avatar Feb 20 '15 16:02 wkornewald

Hi @wkornewald, I'd really like to get this added in, but I'm not sure what the most idiomatic way to get it working would look like.

What's your expectation in terms of how you'd like it to work? Something using gevent or twisted ? Or something else entirely?

KushalP avatar Feb 24 '15 13:02 KushalP

Hi Kushal, I guess an asyncio version would be nice, but in general I was thinking of it being pretty transparent from the user's perspective:

Non-streaming calls would still work like they currently do (call a func, get return value).

Streaming events could simply be callback-based. You'd call a func to register the callback and get a return value which can be used to unregister the callback later.

For simplicity's sake, I'd probably use a separate connection in its own thread for each registered callback. No need to mess with demultiplexing responses (too complex, no practical advantage here).

wkornewald avatar Feb 24 '15 14:02 wkornewald

I am not sure if this is the same request, but I would like to see support for serf's query command.

It would be nice to be able to send a query and receive all the replies from all members.

charleswhchan avatar Sep 29 '15 21:09 charleswhchan