Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start-chsk-router loop question #96

Closed
hellonico opened this issue Jan 22, 2015 · 1 comment
Closed

start-chsk-router loop question #96

hellonico opened this issue Jan 22, 2015 · 1 comment

Comments

@hellonico
Copy link

I am using a slightly modified version of the default router loop::

     (if-not (sente/event-msg? event-msg)
                  ;; Shouldn't be possible here, but we're being cautious:
                  (do 
                   (errorf "Bad event: %s %s" event ch-ctrl) ; Log 'n drop
                   (if (nil? event) 
                        (do 
                          (errorf "Closing channel on null event") 
                          (async/close! ch-ctrl))))
                  (event-msg-handler event-msg))

This plays well with the component workflow, and allows to restart the websocket when needed.
Question was if there was any side effect that could be seen with such a change ?
If not, can we merge it here ?

  1. Without the fix above, the code just keeps on looping and the whole becomes unusable.
  2. When the server side is up again, reconnection on the client side works as expected.
@ptaoussanis
Copy link
Member

Hi Nicolas,

I believe a number of folks use Sente with a lifecycle management approach, unmodified. Have you checked the docs here?

@danielsz has some code here for example that may be helpful?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants