Closed michaelbeaumont closed 3 years ago
Imho not a problem in real-world scenarios, since the time it takes the sender to send a request will exceed the time it takes for the callback to be invoked, by far. But fair enough.
Just fyi: I rather see a possible issue in case a custom dispatcher is being used -> invoking the callback and sending a request without buffering it in between (basically going straight to ws.Write) will cause a deadlock, since there is no goroutine to actually read that data yet. Would have to make the channel buffered to cover this edge case.
I think the expected behavior is to have
newClientHandler
finish running before requests and responses start coming, which isn't a given without this PR.