Type Safely

Type Safely

Share this post

Type Safely
Type Safely
Use an Actor To Encapsulate Asynchronous Code

Use an Actor To Encapsulate Asynchronous Code

Daily Coding Tip 226

Type Safely's avatar
Type Safely
Jan 08, 2023
∙ Paid

Share this post

Type Safely
Type Safely
Use an Actor To Encapsulate Asynchronous Code
Share
person holding black and white quote board
Photo by Jon Tyson on Unsplash

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 …

Keep reading with a 7-day free trial

Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Type Safely
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share