Why do some code chapters (.e.g. 10) define the FetchAnimalsService
and AnimalStoreService
as actors, and other chapters (e.g. 5) define them as structs?
For example, in the chapter 5 folder, I found this commit replacing actor
with struct
.
I understand what an actor
is, and how it’s used to prevent multiple threads from accessing data, but these service types don’t seem like they need to protect any data, so I’m curious why you would ever want to define them as actors. Thanks!