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

Source

@Operator
abstract ActorPool get(Str name)

Returns the ActorPool mapped to the given name, or throws a IocErr / NotFoundErr if it doesn't exist.

make

Source

static new make(Str:ActorPool actorPools)

Creates an ActorPools instance. Use in non-IoC environments.

stats

Source

abstract Str:Int stats()

Returns a map of ActorPool names and the number of times it's been requested.