#1324 - making sure that ActorPools are prefilled

This commit is contained in:
Viktor Klang 2011-10-31 22:18:21 +01:00
parent f5f2ac0bef
commit a6c4bfa98c

View file

@ -95,6 +95,10 @@ trait DefaultActorPool extends ActorPool { this: Actor ⇒
val defaultProps: Props = Props.default.withDispatcher(this.context.dispatcher)
override def preStart() {
resizeIfAppropriate()
}
override def postStop() {
_delegates foreach evict
_delegates = Vector.empty
@ -112,7 +116,7 @@ trait DefaultActorPool extends ActorPool { this: Actor ⇒
select(_delegates) foreach { _ forward msg }
}
private def resizeIfAppropriate() {
protected def resizeIfAppropriate() {
val requestedCapacity = capacity(_delegates)
val newDelegates = requestedCapacity match {
case qty if qty > 0