Allow overriding PoisonPill in ActorPool
ActorPool always kills delegates with PoisonPill. This means you can't use backoff if delegates perform asynchronous work, because a delegate might get killed even if it's still planning to send out a reply later.
If delegates potentially defer sending replies until a later time, what you'd want to do is remove the delegate from the pool (so it doesn't get any new tasks) and maybe have the delegate stop itself when it's done with whatever it was doing. Perhaps send the delegate a DieWhenDone message.
Two potential solutions I thought of so far:
If delegates potentially defer sending replies until a later time, what you'd want to do is remove the delegate from the pool (so it doesn't get any new tasks) and maybe have the delegate stop itself when it's done with whatever it was doing. Perhaps send the delegate a DieWhenDone message.
Two potential solutions I thought of so far:
- virtualize the "send PoisonPill" step in DefaultActorPool so a subclass can override it
- a general feature of Actor allowing an actor to ignore PoisonPill, so a delegate could take the PoisonPill as a suggestion to stop itself later, rather than having Akka stop it immediately
Leave a comment
on 2011-10-04 12:30 *
By viktorklang
I suggest adding a callback method in ActorPool that gets called to stop the actor, by default it will send a PoisonPill to the actor, but the behavior could easily be overriden.
Fixed in master, override the evict(delegate: ActorRef)-method to coustomize, by default it uses PoisonPill
Updating tickets (#1129, #1132, #1138, #1149, #1153, #1154, #1157, #1161, #1163, #1168, #1170, #1171, #1172, #1176, #1177, #1178, #1180, #1199, #1217, #1218, #1219, #1237, #1238, #1239, #1244, #1246, #1249, #1250, #1251, #1252, #1256, #1301, #1302, #1306, #1395, #1396, #1409, #1418, #455, #891, #895, #912, #956, #972, #1031, #1374, #880, #1125, #1146)