Skip to content

Expose IoHandle or some way to register mio Evented #60

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

Closed
passcod opened this issue Aug 16, 2019 · 10 comments
Closed

Expose IoHandle or some way to register mio Evented #60

passcod opened this issue Aug 16, 2019 · 10 comments
Labels
api design Open design questions enhancement New feature or request

Comments

@passcod
Copy link

passcod commented Aug 16, 2019

Currently this is hidden as an implementation detail of the network driver. Exposing would make it possible to hook up arbitrary Evented e.g. for other kernel event sources.

Perhaps this doesn't belong in async-std... in that case, maybe it could be extracted to another crate?

@sdroege
Copy link

sdroege commented Aug 17, 2019

IMHO this would indeed be very useful to have as public API for being able to write other crates that integrate with the async-std reactor/executor without having to reinvent all that again (plus spawning their own threads for it).

With mio being the de-facto standard for an abstraction over epoll and friends, it would also seem like the ideal choice for that.

However I remember there being talks about doing an API-breaking release soon, and it's not at 1.0 yet either so exposing mio types in the public API would potentially block an 1.0 release of async-std.

@passcod
Copy link
Author

passcod commented Aug 17, 2019 via email

@sdroege
Copy link

sdroege commented Aug 17, 2019

I believe that might be a valid way forward for the time being until mio or an alternative is 1.0-stable.

@ghost
Copy link

ghost commented Aug 18, 2019

I would suggest creating rolling your own mio::Poll instance and maybe driving it in a separate thread rather than attempting to hook into async-std.

We're hesitant about exposing mio's interface mainly because we might replace it with a different library in the not-too-distant future.

@passcod
Copy link
Author

passcod commented Aug 18, 2019 via email

@yoshuawuyts
Copy link
Contributor

Full agree with @stjepang here. Wanted to add that I'm also sympathetic to having the ability to hook into async-std's io event loop, and it'd be interesting in findings ways to do so. But given the main benefit is mostly for performance, I agree it's not quite a priority at the moment.

@sdroege
Copy link

sdroege commented Aug 18, 2019

But given the main benefit is mostly for performance

I'd say the main benefit is that it reduces the amount of boilerplate and code duplication considerably, and thus the maintenance burden on other crates. But of course it increases it here by having some more API surface to care about.

For the time being, would you accept a PR that adds something behind some kind of unstable feature flag here as long as it's not very intrusive?

@yoshuawuyts yoshuawuyts added the enhancement New feature or request label Sep 17, 2019
@yoshuawuyts
Copy link
Contributor

This is not something that's a priority in the short/medium term. Spawning a separate event event loop seems like a reasonable intermediate solution.

Going to go ahead and close this to remove it from our active backlog, but this is definitely something we may want to revisit in the future!

@mzji
Copy link

mzji commented Sep 18, 2019

How about label this issue as postponed? It will be useful for reminding us to revisit these issues when we want.

@yoshuawuyts yoshuawuyts added the api design Open design questions label Sep 18, 2019
@yoshuawuyts
Copy link
Contributor

We don't have such a label yet, and out of experience it's not usually something that gets looked at. This is bound to keep coming up though, so I think we'll be fine.

Marked it as "api design" for now, as that feels the closest reason why we couldn't move forward with this (:

moh-eulith pushed a commit to moh-eulith/async-std that referenced this issue Mar 31, 2022
Replace vec-arena with slab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api design Open design questions enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants