Depending on the underlying operating system primitive, there is a potential race condition to be aware
of. Some event notification mechanisms (for example, kqueue on BSD and epoll on Linux) will return
multiple events. If your application operates on pairs of file descriptors (a proxy server maybe), and an
error on one descriptor can lead to closing the other descriptor, then an outstanding event on the other
descriptor can still be queued for delivery to you. Be prepared to receive events for a descriptor that
has already been closed.