Closed benjumanji closed 3 years ago
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nastevens (or someone else) soon.
If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.
Please see the contribution instructions for more information.
I can see that this probably won't compile without bumping the MSRV. What's the policy on that?
For managing pins I much prefer pin-project-lite
- the API is clearer to me and it doesn't change the signature of poll
functions. It's also what the tokio
project itself uses, which seems like a pretty good endorsement 😃
Before I go into a detailed review I'd like to get @posborne's thoughts on overall direction. Do we release a new major version with only Futures 0.3 support? Or should that support be behind a different feature flag (like use_futures_03
? Or some other option not listed here?
@benjumanji are you using this library in a project? If so, what are your opinions on what would work best for your workflow?
I am using it for a project yes, but I am happy to run my own fork (praise be to cargo for making this so easy) until you have a clear idea of how you want this merged, so I'm easy.
For managing pins I much prefer
pin-project-lite
- the API is clearer to me and it doesn't change the signature ofpoll
functions. It's also what thetokio
project itself uses, which seems like a pretty good endorsement smiley
I'll switch over to that.
Before I go into a detailed review I'd like to get @posborne's thoughts on overall direction. Do we release a new major version with only Futures 0.3 support? Or should that support be behind a different feature flag (like
use_futures_03
? Or some other option not listed here?@benjumanji are you using this library in a project? If so, what are your opinions on what would work best for your workflow?
I've been thinking about this more, I think a major version bump that just supports new futures would suit me best. This is a relatively small library, so I think back porting bug fixes to prior versions wouldn't be so painful. Maintaining both kinds of futures impl behind gates seems work for not so much gain.
I've been thinking about this more, I think a major version bump that just supports new futures would suit me best.
Yup, I think I agree with you there. I think it also helps that there are compat layers that can be used to go to/from futures 0.1/0.3.
Plus, with sysfs-gpio being removed from the kernel soon (or already removed? I forget...), this library won't be needed anymore right? Because embedded devices always use the newest kernel? /s
😉
Something that is kind of a bummer, which I haven't yet figured out is caused by me not knowing what I am doing or is inherent to new tokio, is this pr means that you can't create a stream outside of a reactor anymore.
EDIT: having read around a bit more, and seeing that tokio-serial has the same new restriction I don't feel bad about this anymore.
Plus, with sysfs-gpio being removed from the kernel soon (or already removed? I forget...), this library won't be needed anymore right? Because embedded devices always use the newest kernel?
cries in legacy kernel
@nastevens , I think, 4.19 with us for years.
Hi, I have migrated my project to futures 0.3 using the fork for this PR. the features I use are working.
Regarding the version for the new release I also vote for a new major version and cutting the support for the old futures API.
This PR would resolve #56
Thanks for the work.
Thank you for testing it out!
@nastevens @pheki Is it any chance that this PR will be merged?
@nastevens @ryankurte I added a few commits to this to hopefully get things into a mergeable state. I didn't get a chance to run on hardware this evening as I didn't have anything handy to test with ATM but can throw it on something to validate.
Thanks for cleaning it up! :grimacing: Funnily enough for my own projects I have actually dropped async entirely and migrated to the cdev driver, but for the few months that I had it running on devices (fleet of rpis) it worked just fine.
Is there anything against merging this? I want to make a PR with several updates and then make a new release and merging this one first would be great.
Is there anything against merging this? I want to make a PR with several updates and then make a new release and merging this one first would be great.
@eldruin i'd prefer to have an updated tokio dep but if you're planning to resolve that in your updates, no opposition from me! from previous feature experience, it's probably worth adding to the test matrix a build with / without the use_tokio
feature enabled so we can make sure both stay working (and idk whether we have a preference for dashes or underscores in feature names?)
@ryankurte about the naming convention, I went to check and according to the official API guidelines by the rust library team it's unclear, but:
Sources:
I proposed using async-tokio
as a feature name like in gpio-cdev
at #67
Fixed in #69. Thank you for your work!
First effort at adding support for the new futures ecosystem. I haven't given it much of a run through yet, this is more just to let people know I am working on it. Comments welcome.