Closed zenhack closed 1 year ago
...by using spsc, an unbounded queue, instead of a channel for messages.
This makes use of spsc's .Close() method, introduced in https://github.com/capnproto/go-capnproto2/pull/449
In principle, without this you could deadlock the event loop by creating a websocket connection and then never actually calling .Decode(), though this is unlikely in normal use.
Can't merge this until the corresponding go-capnp pr is merged, so parking it here for now.
...by using spsc, an unbounded queue, instead of a channel for messages.
This makes use of spsc's .Close() method, introduced in https://github.com/capnproto/go-capnproto2/pull/449
In principle, without this you could deadlock the event loop by creating a websocket connection and then never actually calling .Decode(), though this is unlikely in normal use.