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

Use async/await and futures 0.3 #5542

Open
nrc opened this issue Sep 26, 2019 · 6 comments

Comments

@nrc
Copy link
Contributor

@nrc nrc commented Sep 26, 2019

Async/await is on the path to stable, and is much clearer to read and write than raw futures. Tokio is also working on futures 0.3 native support, so it would be great to use async/await and futures 0.3 in TiKV. We probably want to do this migration in gRPC and Raft before getting started here, otherwise we'll have to mess around with the compatibility layer.

@Hoverbear

This comment has been minimized.

Copy link
Member

@Hoverbear Hoverbear commented Sep 26, 2019

This might be a fairly long task but there'd be ample mentorship opportunities and lots of small tasks we could plan out and work on!

@palash25

This comment has been minimized.

Copy link

@palash25 palash25 commented Oct 1, 2019

Hi 👋 I am very new to Rust and I am looking to make my first PR so if this task can be broken into smaller task please ping me I would like to take a crack at one of those 😄

@nrc

This comment has been minimized.

Copy link
Contributor Author

@nrc nrc commented Oct 7, 2019

Hi @palash25, although this is going to be fairly easy, I think it will not be easy enough if you are new to Rust (unfortunately the labels aren't fine-grained enough, but there should be something like: easy-ish, no experience with TiKV needed, suitable for an intermediate Rust programmer).

There are probably some tasks in TiKV which are suitable, perhaps #4923 or #4508 ?

@hk1997

This comment has been minimized.

Copy link
Contributor

@hk1997 hk1997 commented Oct 13, 2019

Hi, I would like to take up this issue.
@Hoverbear @nrc Can you help in breaking it up into smaller tasks.

@nrc nrc removed the D: Easy label Oct 22, 2019
@nrc

This comment has been minimized.

Copy link
Contributor Author

@nrc nrc commented Oct 22, 2019

Hi @hk1997, a good first task would be to identify everywhere where we use futures. Primarily identify any futures which we define ourselves (I think mostly we use futures from grpc-rs) and then find places where they are used - I think most important (and easy to find) is where we return a future from a function.

Depending on what you find will influence what we do next. I think we will want to find some boundaries where we convert from 0.1 to 0.3 futures and then change as many uses as we can to async/await.

@siddontang

This comment has been minimized.

Copy link
Contributor

@siddontang siddontang commented Nov 11, 2019

I think we can start this work now. maybe at first, we must upgrade to the newest toolchain :-)

@nrc can you open a project and create some tasks, so we can involve the community to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.