3 ms·
I run into this sometimes for `std` rust libraries; generally involving networking. Not directly mentioned in the article, but I prefer to wrap a `block_on` in
by the__alchemist 3y ago
I run into this sometimes for `std` rust libraries; generally involving networking. Not directly mentioned in the article, but I prefer to wrap a `block_on` in a thread, and use `std::sync::mpsc`, or as required, to manage state.
On embedded, I make my own libraries for everything; the open-source community has gone full-in on either Async, or an typestate/generic API. I don't see this changing any time soon, but maybe later down the road. I feel like the only one who doesn't like either.
- bpye 3y agoDo you have any open source embedded projects? I’m curious of the direction you’ve gone in.
- the__alchemist 3y agoHere's one: https://github.com/David-OConnor/stm32-hal https://github.com/David-OConnor/stm32-hal Device IC code generally ends as files in my firmware directly.
- MrBuddyCasino 3y agoNah same, I find the typestate pattern to be overprotective against bugs that usually get caught during development, and async Rust is just a killjoy overall.