scala - Where to shutdown actors -
We have a lot of actors that have been created in the form of
class BankActor Extends the actor {def receive = {Case CreateCustomer (message) = & gt; Context.actorOf (CustomerActor)! Message}} and customer actors make other actors the same way. The reason for making actors in such a way can potentially be hundreds of (or thousands) CreateCustomer messages, Will get in. I thought that there is a better way of making them on the fly (given actor less memory footprint) I did not think that being a "pool" of CustomerActor was the right thing to do because the Biz REQ is clear that there will be lots of messages and "CreateCustomer" messages too much, can you share your thoughts on this? Now going back to question about the prevention of "subscription": Where should I go to the .stop (self) within the "received" method of "customeractor", whether there is the last thing in every "case" block needed? What is the best practice around it?
Avoid making top-level actors (use theme .actorOf)
If you do not want to shut down within the created actor, then send a zoogePil to the newly created actor after the "message".
Expands class actuator actor {DRF receive = {case content customer (message) => Val Customer = Reference. Factors (Props [Customer Payee]) Customers! Message subscriber! PoisonPill // Message order is preserved on a per-send basis (for all normal mailboxes)}}
Comments
Post a Comment