Async / Await vs. PipeTo in Akka.NET Actors
Best Practices and Patterns for Asynchronous Programming with Akka.NET Actors
Many years ago I wrote an article entitled “How to Do Asynchronous I/O with Akka.NET Actors Using PipeTo” - back when await
support was still very much a work in progress. I subsequently wrote a major update on that article in 2016 - talking mostly about the benefits of PipeTo
from a structural point of view.
I recently learned that this article has many of our own users under the impression that Akka.NET actors don’t support await
semantics properly and that PipeTo
is the only “blessed” pathway for working with asynchronous operations inside actors. This is not the case - await
has had first class support inside actors for many years now.
That’s what this post and video cover: async
, await
, and PipeTo
- how do they work differently, when should you consider using one over the other, and what are the “gotchas” that you need to know?
If you want to see the code sample that goes along with this video and blog post, you can find that here: https://github.com/Aaronontheweb/Akka.AsyncAwait