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.
After each read/write, the poller de-registers the read/write notification event from its watchlist (explicitly for epoll, implicitly for kqueue as there we use oneshot registrations). That means a subsequent read/write needs to be registered again. Some applications want to read/write in a loop (i.e. read in the OnRead callback, analog for writes). In that case, we can save some time by not de-registering the read/write on a poll. The caller will then have to explicitly cancel the read/write.
After each read/write, the poller de-registers the read/write notification event from its watchlist (explicitly for epoll, implicitly for kqueue as there we use oneshot registrations). That means a subsequent read/write needs to be registered again. Some applications want to read/write in a loop (i.e. read in the OnRead callback, analog for writes). In that case, we can save some time by not de-registering the read/write on a poll. The caller will then have to explicitly cancel the read/write.