Closed khmelevskii closed 1 year ago
@khmelevskii Hi Yurii. No, currently this isn't configurable.
Should be easy to make this configurable here, PR welcome. Would suggest this value be separately configurable for WebSockets and Ajax, both defaulting to 5000 msecs: e.g. :msecs-allow-reconnect-before-close-ws
, :msecs-allow-reconnect-before-close-ajax
.
Just curious - what's your motivation in wanting a shorter timeout here?
@ptaoussanis great, I will create PR.
About motivation. In my app I have user online/offline status on UI. To show this I'm using :chsk/uidport-open
and :chsk/uidport-close
events. When :chsk/uidport-close
triggered I'm checking connected-uid and if user doen't exist (doesn't have connected other clients)I set status of this user to "offline".
When :chsk/uidport-close triggered I'm checking connected-uid and if user doen't exist (doesn't have connected other clients)I set status of this user to "offline".
So that's a typical use case, but what's your motivation for reducing the timeout specifically? Note that there's tradeoffs with a lower timeout - you'll get more false-positive :chsk/uidport-close
events with a lower timeout. I.e. could make your online/offline status UI more noisy.
I think this is totally fine to be more noisy here. For example I can see that status in Slack updates immediately (when user refresh slack page I can see that his status blink).
Great, thanks for the confirmation. PR welcome 👍
Closing, this will be included in forthcoming v1.18 👍
Can I configure this 5 second? For example I'm going to use 1500ms. In case that I will be able to change this value it will influence to something?