Use an Actor To Encapsulate Asynchronous Code
Daily Coding Tip 226
An Actor is similar to class, but it’s built for asynchronous tasks.
Even functions of an Actor that aren’t marked as async will be considered asynchronous by other types that call those functions. This is because an Actor may be receiving multiple messages simultaneously, and it deals with these messages asynchronously so …


