These are chat archives for fanout/pushpin

14th
Apr 2017
Francis Eytan Dortort
@dortort
Apr 14 2017 05:30
@jkarneges Thanks. Is that by design or are there plans to allow control of ws connections via control service or zmq command direclty?
Justin Karneges
@jkarneges
Apr 14 2017 07:49
Mostly by design. It may be interesting to add direct control of connections, but the refresh command makes it easier to build your application
combined with the Keep-Alive-Interval response header, you can have a self-healing system
Francis Eytan Dortort
@dortort
Apr 14 2017 08:51
Is the empty body all that distinguishes a websocket-over-http request triggered by the "refresh" from other requests?
Justin Karneges
@jkarneges
Apr 14 2017 17:06
Almost. If Keep-Alive-Interval is used, then requests after the timeout would also have an empty body.
if you're not using that, then I believe the only other way to get an empty body would be with refresh. however, you probably shouldn't depend on this

I suggest always attempting to repair the subscription state whenever a request comes in. the process could be something like: 1) add pending sub/unsub to user session in database, 2) call refresh command

then in your request handler code, check the user session for pending work and send any control commands

Justin Karneges
@jkarneges
Apr 14 2017 17:13
another thing you could do is use websocket-over-http Set-Meta to keep track of state
Francis Eytan Dortort
@dortort
Apr 14 2017 17:51
Thanks. The pending sub/unsub queue approach is perfect for my use case :)