-
Notifications
You must be signed in to change notification settings - Fork 69
Add Readable and Writable futures #64
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
Conversation
ad7c387
to
8aa4a86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat!
What happens if the |
Hmm...
|
In this case, the error is expected behavior, but I think I should have left a reference to 1.5.0 has only been released about 2 hours ago, and I think the only thing that depends on this feature is async-net's master, so I'll yank 1.5.0... @Kestrer Thanks for catching this problem. |
Oh no, is there no way to support this? Would it be possible to for example perform a check if the resource has been unregistered and have Readable error out? |
I think it is possible, but I would like to provide an API that prevents such error if possible. In fact, the error that occurs, in that case, can be easily reproduced by more low-level libraries such as polling, so this PR's API is not necessarily bad. So, we could simply add documentation that says "If writable/readable polled after Async dropped, it will result in an error", but I tend to think it is better if this could be prevented at compile time... (I'm still not convinced it's worth the breaking change, but we found the problem fast enough that I didn't have to worry about the impact of the breaking change, so I yanked 1.5.0 anyway. Sorry if anyone else is affected by this yanking!) |
And here is the API & implementation I'm thinking of: master...taiki-e/owned I'm not sure about other use cases where this feature was needed, but it is enough for the async-net use case (smol-rs/async-net@master...taiki-e/owned), @Kestrer @smol-rs/admins Any thoughts on this? |
I think this is a good idea. |
No description provided.