Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Migrate to async/await #1638

Closed
3 tasks done
thomaseizinger opened this issue Nov 11, 2019 · 0 comments
Closed
3 tasks done

Migrate to async/await #1638

thomaseizinger opened this issue Nov 11, 2019 · 0 comments
Labels
Epic Epic issue

Comments

@thomaseizinger
Copy link
Contributor

thomaseizinger commented Nov 11, 2019

async/await landed on stable Rust in version 1.39 on 07.11.2019!

This epic tracks all issues that are related with moving our codebase to async/await.

Current setup

  • You can use async/await within the cnd and btsieve crates (those have the necessary compatibility layers setup that are required to have new and old Futures work together)
  • Some code parts are already making heavy use of async/await (f.e. btsieve internals)

What do we need to migrate everything (without a compatibility layer)?

Benefits

Converting the codebase to async/await is expected to bring the following benefits:

Less code

Writing asynchronous code with async/await instead of using combinators on Future needs significantly less LoC to express the same functionality.

Better ergonomics

Usage of combinators often requires cloning of references. This boilerplate is going away with async/await.

Better organization of code

With async/await, code reuse goes back to declaring a function (an async one). On the other hand, code reuse through manual creation of Futures requires the definition of structs.

More concretely, moving to async/await should allow for an easier way of reusing code because it is just functions (again).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Epic Epic issue
Projects
None yet
Development

No branches or pull requests

2 participants