Skip to content
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

Possible to do away with global REACTOR? #6

Closed
joshuawarner32 opened this issue Aug 22, 2018 · 1 comment
Closed

Possible to do away with global REACTOR? #6

joshuawarner32 opened this issue Aug 22, 2018 · 1 comment

Comments

@joshuawarner32
Copy link

This is an awesome project, it's really helped me understand the mechanics of futures better! Thank you!

One thing I haven't quite wrapped my head around is why we need any sort of global REACTOR. Each task is polled from an EventLoop - and indeed we're already passing the EventLoop instance up the stack in the guise of a Handle (er... a Spawn, which of course can't be down-casted), as part of the Context. It seems very awkward to require using global state, when we have all the state we need, already passed around to the proper places through a Context object (just inaccessible ☹️).

It seems it would be much cleaner to be able to down-cast some part of the Context in order to call add_read_interest in the "leaf" Future implementations (like AsyncTcpStream). This would of course require a change to the Context API.

Thoughts?

@polachok
Copy link
Owner

I was going to redirect you to wg-net discord, but I see you already discussed it there!
Sorry for late reply.

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