Simplifying Asynchronous Code With Scala Async
summary
A macro library implements async/await macro that transforms regular Scala code into an efficient state‑machine, returning Scala 2.10/2.11 futures and avoiding language changes. It integrates with the Futures and Promises API, supports a reactive variant (rasync for observables) that yields and awaits stream events, and offers a sequential debugging mode that runs async blocks on one thread for stepping. The implementation is open source on GitHub and claims non‑blocking suspension with low allocation overhead; examples and limitations (no await inside closures or by‑name args) are demonstrated.
AI-written summary · about
chapters (19)
- 0:00Intro
- 1:56THE PROBLEM
- 4:07INSPIRATION
- 6:57GENTLE INTRO TO ASYNC Async provides two constructs: async and wait
- 8:12USING ASYNC
- 12:18IN SHORT
- 14:02PLAY FRAMEWORK EXAMPLE
- 18:50ANOTHER EXAMPLE
- 20:22BACK TO USING FOR
- 23:14DIRECT STYLE
- 24:56USING AWAIT
- 28:19NEW FEATURE
- 30:05EXPERIMENTAL EXTENSION
- 33:20RAY: RASYNC, AWAIT*, YIELD
- 36:21CONCLUSION
- 38:12WHAT IS IT FOR?
- 39:29TAKEAWAY
- 39:46ROADMAP
- 40:29PLUG








