I want to replace the global ActorRegistry with an "actor system" concept. You should be able to run multiple actor systems in the same process at the same time. Any actor lookups, like you today do using ActorRegistry, should only return results from the same actor system. Two actors in two different actor systems should under normal API usage not be able to get references to each other. In other words, an actor system should be isolated from other actor systems.
The use case here is mostly to get rid of the global state maintained by ActorRegistry, not to make it possible to have multiple actor systems in the same process. That's just a convenient side effect. Isolated actor systems will also be of great help in tests, and should make parallel test running possible since tests no longer share any global state.
Today's ActorRegistry API can maybe be kept around as a convenience wrapper around a default actor system.
I think an actor system concept would also resolve #30 (cyclic initialisation).
Register actors with an actor system (a bag)
Once all participating actors have been initialised (i.e., they're ready to receive messages; even before their on_start() handlers have been called), the actor system would then call each actor's on_start() to execute once-off behaviour
I want to replace the global
ActorRegistry
with an "actor system" concept. You should be able to run multiple actor systems in the same process at the same time. Any actor lookups, like you today do usingActorRegistry
, should only return results from the same actor system. Two actors in two different actor systems should under normal API usage not be able to get references to each other. In other words, an actor system should be isolated from other actor systems.The use case here is mostly to get rid of the global state maintained by
ActorRegistry
, not to make it possible to have multiple actor systems in the same process. That's just a convenient side effect. Isolated actor systems will also be of great help in tests, and should make parallel test running possible since tests no longer share any global state.Today's
ActorRegistry
API can maybe be kept around as a convenience wrapper around a default actor system.