* Add better documentation for the IOCP module
* Extract Events from Poller
This prevents the need to have an intermediate buffer to read events
from, reducing the need for an allocation and a copy. This is a breaking
change.
* Add event extra information
Foundation for more details later on.
* Add PRI and HUP events
* Fix various failing tests
- Make sure that waitable handles interact properly with the new
infrastructure
- Fix failing doctests
* Review comments
- Make set_* take a boolean for the value of the flag
- Make Events !Sync
- Fix visibility modifiers
- Inline more methods
- Use a better strategy for testing
* Move completion packets into the Events buffer
This removes one of the mutexes that we have to lock.
* Review comments
Signed-off-by: John Nunley <dev@notgull.net>
* feat: Expose other kqueue filters
* Fix netbsd/openbsd compilation
* Build MSRV for FreeBsd/OpenBsd in CI
* Only run MSRV BSD builds on Linux
* Change API a little + fix netbsd timer
* Add inlines + move PollerSealed
* rustfmt
* Make filter fields public
* Fix examples
This replaces Poller.insert() and Poller.interest() with Poller.add()
and Poller.modify(), and renames Poller.remove() to Poller.delete().
The method Poller.add() is used for adding a new file descriptor, while
Poller.modify() is used for updating an existing one. Poller.remove() is
renamed to Poller.delete() so the naming scheme of these methods follows
that of epoll, wepoll, etc.
This new setup means that adding a new socket only requires a single
call of Poller.add(), instead of a combination of Poller.insert() and
Poller.interest(). This reduces the amount of system calls necessary,
and leads to a more pleasant API.
On systems that use kqueue or ports, the behaviour of Poller.add() and
Poller.modify() is the same. This is because on these systems adding an
already existing file descriptor will just update its configuration.
This however is an implementation detail and should not be relied upon
by users.
Migrating to this new API is pretty simple, simply replace this:
poller.insert(&socket);
poller.interest(&socket, event);
With this:
poller.add(&socket, event);
And for cases where Poller.interest() was used for updating an existing
file descriptor, simply replace it will a call to Poller.modify().
See https://github.com/stjepang/polling/issues/16 and
https://github.com/stjepang/polling/pull/17 for more information.
This adds redundant system call overhead for file descriptors which have
already been turned into non-blocking file descriptors. In addition, the
polling crate doesn't need to implement platform specific code for
enabling non-blocking mode. Instead, users of polling can do so using
(for example) standard library methods such as
TcpListener.set_nonblocking().
See https://github.com/stjepang/polling/issues/16 for more information.