Skip to content

PollOpt is deprecated for event trigger types in MIO #699

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

Open
vertexclique opened this issue Feb 5, 2020 · 3 comments
Open

PollOpt is deprecated for event trigger types in MIO #699

vertexclique opened this issue Feb 5, 2020 · 3 comments

Comments

@vertexclique
Copy link
Member

Looks like with mio 0.7.* PollOpt is not there anymore.
So we need to refactor the code to don't pass PollOpt along with interests.

@vertexclique vertexclique changed the title PollOpt is deprecated for event completion types in MIO PollOpt is deprecated for event trigger types in MIO Feb 5, 2020
@jdafont
Copy link

jdafont commented Feb 5, 2020

I’d like to take a swing at this!

@jdafont
Copy link

jdafont commented Feb 6, 2020

So, I've looked into the issue and I'm just going to summarize the findings here to save time for others.

Mio removed PollOpts from the public API here: tokio-rs/mio#975

The purpose of this was to reduce the scope of the API and no longer support oneshot events as described here: tokio-rs/mio#928

Mio simply drops the parameter since there is only the one supported mode now (Edge triggered). Fortunately, async-std only uses this in one spot:

let opts = mio::PollOpt::edge();
self.poller.register(source, token, interest, opts)?;

The solution here is to simply remove opts. But, this would only compile with Mio at version 0.7 of course. Is there a branch to convert async-std to mio 0.7?

@vertexclique
Copy link
Member Author

@guiri14 Not in my knowledge. @stjepang Are you willing to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants