scala - How to share state between Akka actors? -


i have balancesheetactor defined follows:

class balancesheetactor extends actor {    val tradables = mutable.set[contract]  } 

and have simple depositcontract defined follows:

case class depositcontract(facevalue: double) 

each contract in model asset 1 balancesheetactor , liability balancesheetactor , state of contract shared between actors (i.e., each contract member of @ least 2 sets of tradables).

suppose want increment facevalue of depositcontract amount. either need to...

  1. remove old contract both sets of tradables , replace new depositcontract(facevalue + amount).
  2. model each contract akka.agent.
  3. model each contract akka.actor (and encapsulating state).

option 1 seems needlessly complicated (additionally contracts highly out of sync), option 2 seems ok need create on order of millions of contract agents , concerned memory usage. have similar concerns option 3 well. have no idea if these memory usage concerns founded. thoughts?

i hoping there option 4 scala/akka noob has not thought of...


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -