Sonic is a Go library for network and I/O programming that provides developers with a consistent asynchronous model, with a focus on achieving the lowest possible latency and jitter in Go.
Right now we have AsyncNextMessage(b []byte, ...). Inside this we memcpy the message into the user supplied buffer. We need to offer an alternative that just returns the websocket's buffer in a callback. For messages composed of multiple frames, we can return a list of buffers, one for each frame.
Right now we have
AsyncNextMessage(b []byte, ...)
. Inside this wememcpy
the message into the user supplied buffer. We need to offer an alternative that just returns the websocket's buffer in a callback. For messages composed of multiple frames, we can return a list of buffers, one for each frame.