- Index
- »
- concurrent
- »
- ActorPool
type
ActorPool
src
@Js
const class ActorPool : Obj
Controller for a group of actors which manages their execution using pooled thread resources.
See Actors
constructors
make |
It-block constructor |
---|
fields
maxQueue |
Max number of messages that may be queued by actors in this pool. |
---|---|
maxThreads |
Max number of threads which are used by this pool for concurrent actor execution. |
name |
Name to use for the pool and associated threads. |
methods
isDone |
Return true if this pool has been stopped or killed and all its actors have completed processing. |
---|---|
isStopped |
Return true if this pool has been stopped or killed. |
join |
Wait for this pool's actors to fully terminate or until the given timeout occurs. |
kill |
Perform an unorderly shutdown. |
stop |
Perform an orderly shutdown. |
Slot Details
isDone
Return true if this pool has been stopped or killed and all its actors have completed processing. If this pool was stopped then true indicates that all pending messages in the queues before the stop have been fully processed. If this pool was killed, then this method returns true once all actors have exited their thread. See join
to block until done.
isStopped
join
kill
make
maxQueue
src
const Int maxQueue := 100000000
Max number of messages that may be queued by actors in this pool. Once this limit is reached, any messages sent are immediately rejected and their future will raise QueueOverflowErr
. This limit only applies to messages sent via send
and sendWhenDone
. No limit checking is applied to sendLater
.
maxThreads
name
stop
Perform an orderly shutdown. Once stopped, no new messages may be sent to this pool's actors. However, any pending messages will be processed. Note that scheduled messages are not guaranteed to be processed, only those delivered with Actor.send
.
Use join
to wait for all actors to complete their message queue. To perform an immediate shutdown use kill
. If the pool has already been stopped, then do nothing. Return this.