const mixinafConcurrent::ActorPools
afConcurrent::ActorPools
(Service) - Maintains a collection of named ActorPools. Use to keep tabs on your resources, particularly useful when creating SynchronizedMap and SynchronizedList instances.
ActorPools is automatically made available in IoC enabled applications. Contribute to ActorPools via AppModule contributions:
@Contribute { serviceType=ActorPools# }
Void contributeActorPools(Configuration config) {
config["myPool"] = ActorPool() { it.name = "MyPool" }
}
ActorPools is then used behind the scenes to create and inject instances of ActorPool, Synchronized, SynchronizedList, and SynchronizedMap with a named ActorPool. Example:
@Inject { id="myPool"; type=User[]# }
private const SynchronizedList loggedInUsers
Note it is always a good idea to name your ActorPools for debugging purposes.
@uses Configuration of Str:ActorPool
- get
@Operator
abstract ActorPool get(Str name)Returns the
ActorPoolmapped to the given name, or throws aIocErr/NotFoundErrif it doesn't exist.- make
static new make(Str:ActorPool actorPools)Creates an
ActorPoolsinstance. Use in non-IoC environments.- stats
Returns a map of
ActorPoolnames and the number of times it's been requested.