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
ActorPool
mapped to the given name, or throws aIocErr
/NotFoundErr
if it doesn't exist.- make
static new make(Str:ActorPool actorPools)
Creates an
ActorPools
instance. Use in non-IoC environments.- stats
Returns a map of
ActorPool
names and the number of times it's been requested.