-
Notifications
You must be signed in to change notification settings - Fork 129
[IO_URING] Add support for pollAdd operation
#273
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
base: main
Are you sure you want to change the base?
Conversation
|
@swift-ci please test |
c64fc9c to
e69d5c1
Compare
|
@swift-ci please test |
Catfish-Man
left a comment
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 had a few comments but I don't think any of them are necessarily blockers
| /// | ||
| /// - ``PollEvents``: The events that can be monitored. | ||
| /// - ``IORing/Request/cancel(_:matching:)``: Cancelling poll operations. | ||
| @inlinable public static func pollAdd( |
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.
Typically Swift naming style would be verb-first but if there's a good reason to have it this way it's probably fine
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 was trying to match what the io_uring operation was called. I wasn't sure how much we tried to change the naming to fit our Swift naming guidelines.
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 guessed that was probably what you were doing. I remember this coming up during the initial proposal review and iirc folks leaned "don't try to make the names friendlier" so that looking up docs will work better. I'm still torn on it but I see the logic.
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.
Let me know what you prefer and I am happy to change if needed. I am open to both.
## Motivation To observe events on file descriptors IO_URING supports the `pollAdd` operation. This is useful when you want to observe a file descriptor becoming ready to read or write ## Modifications This PR adds a new `IORing.Request.PollEvents` option set to model the poll masks. Furthermore, it adds a new `static func pollAdd` to the `IORing.Request`. ## Result We can now use IO_URING to poll for events on file descriptors.
e69d5c1 to
5353528
Compare
|
@swift-ci please test |
Motivation
To observe events on file descriptors IO_URING supports the
pollAddoperation. This is useful when you want to observe a file descriptor becoming ready to read or writeModifications
This PR adds a new
IORing.Request.PollEventsoption set to model the poll masks. Furthermore, it adds a newstatic func pollAddto theIORing.Request.Result
We can now use IO_URING to poll for events on file descriptors.