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

Async/Await #6

Closed
olanod opened this issue Mar 30, 2020 · 4 comments
Closed

Async/Await #6

olanod opened this issue Mar 30, 2020 · 4 comments

Comments

@olanod
Copy link

olanod commented Mar 30, 2020

Perhaps worth designing those APIs to be async/await friendly from the beginning? Soon everything in the Rust world will be asynchronous and embedded won't be the exception.

@thejpster
Copy link
Member

Yes, I'm very aware of what Ferrous have been up to. Would you like to propose an API?

@ryan-summers
Copy link
Member

Just to add some bit to the discussion - I don't think it's safe to ever say:

Soon everything in the Rust world will be asynchronous and embedded won't be the exception.

I disagree. The article you link talks about this as well - async is really nice for cooperative multitasking, but it does not work well for hard real-time systems (e.g. safety critical) because there's no guarantee when other tasks will release their execution. There's always exceptions and specific use cases in software.

I definitely support adding async/await traits, but I don't think they should be the only possible API. Perhaps we can have an AsyncTcpStack as well as an AsyncUdpStack added that use async read/write functions. Then, drivers that make use of async/await can request the associated async stack.

@chrysn
Copy link
Contributor

chrysn commented Jul 25, 2022

It should be noted in this issue that there is now an experimental crate embedded-nal-async that is being developed as part of this repository.

[edit: All my links and names had a line above the n of nal and accidentally looked like hal ... but the statement holds]

@ryan-summers
Copy link
Member

In light of that, I'm going to close this issue as resolved - thanks for noting this @chrysn! I had neglected to back-trace through issues after approving the async NAL.

We would welcome any further contributions to the async stack!

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

4 participants