-
Notifications
You must be signed in to change notification settings - Fork 114
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
Unable to sendTextData
after receiveData
gets an async exception.
#182
Comments
@michalrus Yes, |
Well, that What I want is a time-outing So if you wrap it in http://hackage.haskell.org/package/base-4.12.0.0/docs/System-Timeout.html, the wrapped call returns with a
|
Oh! I completely misunderstood the question, sorry. Yes, that makes sense to have. |
I think we should implement this the nice way but that will be a breaking change. We basically want to be able to extend As for the API, do you think the timeout should be global (i.e. set on socket/stream creation) or local (i.e. a parameter to receive)? |
I see… IMO, local — see also #32. =) I mean, these issues (+ the ones with ping timeout #174 #159) can certainly be worked around either like proposed by @rwbarton in #32, or some other way with Also not all programmers might be able to implement this correctly, so it’s a better task for the library. Cf. fallacy 1. of https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing:
|
Also, similar to this, imagine: finally
(forever $ receiveTextData conn >>= processMsgSomehow)
(sendTextData conn "bye bye") If I throw an async exception to this simple code above, These API choices of WebSockets prevent writing slightly more, hmmm, refined(?) code, like the one above. |
It’s not possible to implement something like:
… the client will never see the
"timeouted"
message.The text was updated successfully, but these errors were encountered: