WIP backend/rs: Using polling
instead of kqueue
/epoll
#763
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've had this in my git stash for a while. I think it wasn't working properly, but I may as well put in in a PR as a proof of concept.
Wayland-rs is often used with
calloop
, sopolling
is a dependency anyway. It may as well be used here then.This requires
Poller
to implementAsFd
, so it won't work on platforms that only havepoll
. https://docs.rs/polling/3.7.3/polling/struct.Poller.html#impl-AsFd-for-Poller mentions that illumos/solaris implement it. But I don't know if it works properly to insert into another poller.If we want to support platforms that only have something like
poll
, we'll need a different sort of API, that doesn't require a singlefd
for polling multiple clients. Butlibwayland
has the same issue, and there may not be much serious use to wayland-rs on platforms that don't supportlibwayland
.Other than portability, this is a nice cleanup of a bit of platform-specific code, but it's not a huge difference.