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

Exception always raised even with safe shutdown? #157

Open
centromere opened this issue Oct 4, 2017 · 1 comment
Open

Exception always raised even with safe shutdown? #157

centromere opened this issue Oct 4, 2017 · 1 comment
Labels

Comments

@centromere
Copy link

For sendClose:

This exception is when you can finally consider the connection closed.

If I am closing the connection properly, why should an exception ever be raised? Shouldn't exceptions only be raised for exceptional circumstances?

@jaspervdj
Copy link
Owner

I think this is the best way to have a "uniform" way of exiting out of calls like receive. Additionally, it works very well functions like bracket from Control.Exception.

The alternative would be to have receive return the close message, but that:

  1. Is a breaking change (which is hard to argue for)
  2. Breaks the idea that the library takes care of "control messages" (open, close, ping, continue...)

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

No branches or pull requests

2 participants