Feature: non-blocking event interface
A non-blocking event interface is required so applications can ensure all pending events have been addressed before returning. This is required by e.g. epoll
.
Two possible implementations:
-
maybe_next
(or other name) would perform a non-blocking check for events. The implementation could turn blocking off and then on, so thatnext
continues to be blocking. Or the implementation could maintain state indicating if it is in blocking mode, and turn it on/off as required. -
has_event
would maintain an event queue internally, reading up to the maximum number events (based on registered fds) whenever it blocks, andhas_event
would indicate if the event queue is empty.