-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modernize epoll API #1110
base: main
Are you sure you want to change the base?
Modernize epoll API #1110
Conversation
f5f739c
to
db893ae
Compare
Ok, I think the remaining questions are:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big fan of the idea here, but a few notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need some more time to think about this.
The EventBuffer trait as a way to migrate away from EventVec and toward just using a plain Vec or array makes sense.
That said, I have reservations about the use of B::Out
return value, which means that the value you get back, which determines how you use this function, changes significantly depending on what type of thing you pass in, and it's not clear from the public interface how users would figure out this relationship.
I like how eg. read
and read_uninit
have intuitive signatures that don't require you to learn about a trait and look up what types implement it, and I like how they give simple error messages if you use the wrong type.
cc #908, which implemented a trait similar to |
Doh! I'd totally forgotten about that, sorry. And here I thought this was a new idea lol. So if this space was already explored, then maybe we should just add a If we do want to try the fancy pantsy approach, I can make it look a little more like @notgull's original proposal while maintaining the Internal type so nobody can use it but us. |
Signed-off-by: Alex Saveau <[email protected]>
I've been working with |
I still advocate for my |
This PR:
epoll::wait
in non-alloc cratescc @notgull for extra review
@sunfishcode this buffer trait idea seems pretty cool, maybe we should use this pattern in other areas that take uninits?
All of this should be fully backwards compatible.