Background Tasks and Thread Pools in Microservices
(skipping earlier sections of the chapter)
Actix
The main types & traits of actix
:
System
Type: Maintains the actors system. Must be created before any other actors are spawned.System
is itself an actor.Actor
Trait: Anything that implementsActor
can be spawned.Arbiter
Type: AnArbiter
is an event loop controller. Can only have one per thread.Context
Type: EveryActor
works in aContext
, which, to the runtime, represents an actor's environment. Can be used to spawn other tasks.Address
Type: Every spawnedActor
has anAddress
, which can be used to send things to and from a targeted actor.Message
Trait: Types that implementMessage
can be sent thorugh a type that implementsAddress
'ssend
method.Message
has an associated type,Result
, which is the type of value that will be returned after the message is processed.Handler
Trait: Implemented onActor
s and enables/facilitates the actor' message-handling functionality.