Closed tcoopman closed 4 years ago
Good point! I'll make a note of this in the docs. I guess an unintended consequence of allowing the WS handler to shut itself down after the client closes the connection, instead of killing it immediately like I used to...
Well the other option would be to change the API to take an on close handler, but I'm not sure I would like that more. For me it's good as it is.
I'm not saying this is a bug, maybe just something to put a warning in the docs.
When you receive a
Connection_close
on a continuously-running handler but don't returnLwt.return_unit
then the handler will be stuck in an infinite loop with no way to recover from.Depending on how you structured your code, this will also result in a cpu spike because pull will always immediately return with
Empty
.Example of a wrong code with high cpu usage:
So I'm not sure it's fixable by
re-web
but I do think the documentation should be clear about this.