async closures version?#28
Conversation
|
Please add tokio as a dev-dependency, otherwise you break |
|
Also, is there a way to support both sync and async simultaneously? Like, a |
|
If not, I strongly vote for this, @funbiscuit. As async seems to be the future of embedded. For example, It's cumbersome but possible to interact with USB using the current state of this crate, through queues, but it's almost impossible to execute async tasks from handler functions. Which is a very common usecase for an embedded CLI nowadays. And that's exactly what this change would fix. |
you can have copies of every function I had to make async |
I'm not really interested in this crate because I don't need it at the moment, so feel free to work on this yourself, I literally changed like 20 lines of code following my editor to make thism |
That's a tough question, both options (drop sync support or make function duplicates) don't seem good for me. I think you can fork and manually make functions async as shown in this branch. Until a proper solution is found. |
|
actually it's not hard to have both blocking and async version, because blocking code can work with async code, but not viceversa. usually blocking code is seen as more versatile and with more compatibility, but it's actually the opposite. something else entirely is blocking code that does not block but has callbacks, like in C without an RTOS, but that's the same pattern as async. to have a blocking version the caller can just poll once the process function, and if his code is blocking it should be always Poll::ready on the first try. I added a @Finomnis now both blocking and async code are supported. |
|
With priority inversions, I mean even threads of the same priority (in RTIC) will not run if you do not |
|
then we can put an error like |
|
Sounds better, yes :) |
|
@Finomnis what do you think? |
|
I would not return Also again, Tokio should be a dev dependency :) |
|
why is |
Because its only intended use is as the return value of the |
No description provided.