Skip to content

Split Poll into Poll and Register #932

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

Merged
merged 8 commits into from
May 8, 2019
Merged

Split Poll into Poll and Register #932

merged 8 commits into from
May 8, 2019

Conversation

carllerche
Copy link
Member

This also makes Poll::poll require &mut self since Poll is no
longer expected to be stored in a Sync context.

Resolves #757

This is a very large change and I would not look for perfection, just that nothing in the change is terribly broken. This will be but one of many PRs to transition Mio to 0.7 and I am attempting to make it as incremental as possible.

cc @Thomasdezeeuw @stjepang

This also makes `Poll::poll` require `&mut self` since `Poll` is no
longer expected to be stored in a `Sync` context.

Resolves #757
Copy link
Collaborator

@Thomasdezeeuw Thomasdezeeuw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good to me, added some small comments.

The only thing I don't really like is poll.register().register(...) in some of the tests. Maybe get_register or register_ref would make it better.

@carllerche
Copy link
Member Author

@Thomasdezeeuw I agree with you about the tests and poll.register().register(...). However, I hope to punt that until later.

  • Many tests will be deleted (as we delete old functionality).
  • Tests need a general overhaul. I think this would be best done after the Mio API changes are done.
  • I am not sure exactly sure what the best strategy will be for us. We may just want to bring back Poll::register, reregister, deregister and rename register() -> handle() or something. I think we can better evaluate that after the changes we know we want are done.

Thoughts?

@carllerche carllerche requested a review from hawkw April 29, 2019 17:48
Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing I don't really like is poll.register().register(...)

I agree that the stuttering feels weird. What if the type Register were renamed to Registry? Then it reads as poll.registry().register(..)...

@carllerche
Copy link
Member Author

@seanmonstar @Thomasdezeeuw I don't have a huge opinion re: what Register should be called. If we want to change to Registry, we can do that.

@hawkw
Copy link
Member

hawkw commented Apr 29, 2019

FWIW, I'm +1 on renaming Register to Registry

@ghost
Copy link

ghost commented Apr 29, 2019

Same here. Even though Register can be a noun, it sounds more like an action to me, while Registry would be unambiguous.

@Thomasdezeeuw
Copy link
Collaborator

Registry is fine by me.

@carllerche carllerche requested a review from Thomasdezeeuw May 7, 2019 17:04
@Thomasdezeeuw
Copy link
Collaborator

LGTM

@carllerche carllerche merged commit 413a7d3 into master May 8, 2019
@carllerche carllerche deleted the split-poll branch May 15, 2019 20:04
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

Successfully merging this pull request may close these issues.

Split Poll into Poll and Register.
4 participants