Is there a way in Rust to use standard lib traits (Ord, Eq, Into/From...) with async functions?
Perhaps a crate or something?
Or must it be a separate function implemented for the structs?
I am reading the rust for rustaceans book, but it’s not the end of all, I need to implement my learning. What could be the best, short and crisp way to utilise most of async and concurrent feature in a small application?
My goal is to get confident enough that I can build/contribute to something like #pingora or a database like #quadrant
Upcoming, a new & simplified implementation of https://thi.ng/csp (currently still only on a feature branch[2]) for building blocks for Communicating Sequential Processes.
Also still WIP only, async iterable support for https://thi.ng/rdom, i.e. in the same way as rstream subscriptions, such async iterables can soon be directly embedded as component/element bodies or attribute values and then perform pinpointed DOM updates each time their value changes...
As I said, async all the thi.ngs...
[1] h/t @sjb3d for an ancient tweet with a similar sentiment & outcome :)
[2] The CSP package too was somewhat deprecated (for similar reasons) and a while ago I added another alternative CSP implementation via https://thi.ng/fibers, but that package too might see some more refactoring/simplifying by switching to async generators...
@notgull This is such a good blog post. I've learned a lot!
Thank you for sharing. ❤️
"The best part is that the allocation, the Vec<smol::Task<()>>, isn’t even necessary. It could be one-time allocation that is just extended to hold the tasks."
Wow, this is mind-blowing to me - I haven't even considered this before! 🤯
"Now that we’re at the end I want to thank you for reading all the way to the end. I wanted this book to feel like a journey we took together, not like a lecture. I wanted you to be the focus, not me.
I hope I succeeded with that, and I genuinely hope that you learned something that you find useful and can take with you going forward."
I definitely learned a lot! And a journey it has been indeed! This book will be my go-to reference for all things #Async in #Rust!
"io_uring is a new asynchronous I/O API for Linux created by Jens Axboe [...]. It aims at providing an API without the limitations of the current select(2), poll(2), epoll(7) or aio(7) family of system calls [...]."
Been putting the finishing touches on Bunny's transformation into #fibers PR. One of the major things for me there is visualizing the changes, especially the breaking changes. For example switching from a promise based API to a fibers based API:
Phew... One key step closer to replicating & simplifying core https://thi.ng/rstream functionality via just standard async iterables: Just added a mult() base-operator to https://thi.ng/transducers-async [1] which allows splitting a single async iterable into multiple child async iterables (aka subscriptions, aka 1:N splitting), each of which can be added/removed dynamically and individually processed e.g. via transducers, vanilla for await() consumers, and/or used as input for downstream mult()s to construct entire graph topologies (cycles allowed) of async processors etc. Back pressure is handled by waiting for all child subscriptions to deliver the value before consuming a new one from the source...
For @made and others who might have questions about the new https://thi.ng/transducers-async library, I've tried to illuminate the behind-the-scenes approach over here:
🧶 Why choose async/await over threads? - notgull.net
「 Smart programmers try to avoid complexity. So, they see the extra complexity in async/await and question why it is needed. This question is especially pertinent when considering that a reasonable alternative exists in OS threads 」