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

PollEntry mutably borrows the Pollable #4

Closed
FrozenDroid opened this issue Oct 17, 2019 · 1 comment
Closed

PollEntry mutably borrows the Pollable #4

FrozenDroid opened this issue Oct 17, 2019 · 1 comment

Comments

@FrozenDroid
Copy link
Contributor

Great work on the library!

One thing I was a little confused by, is the mutable borrow here. I can't really find a reason why it'd have to be mutably borrowed, since it works just fine when changing it into an immutable borrow.
The reason I had to change this was because I wanted to receive data from the socket after polling it, which was not possible because the socket was already being mutably borrowed by the PollEntry.

I'll drop a PR to change this.

@jonathanpallant
Copy link
Member

I think the idea was to make it clear that you can't read or write while you are polling. It does mean you need to destroy the PollEntry after polling though, and see as the file handles are all just integers anyway, I agree it was probably more trouble than it was worth.

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