added monadic ops to TransactionalRef, fixed bug with nested txs
This commit is contained in:
parent
3be193904d
commit
2998fa4dbc
11 changed files with 265 additions and 231 deletions
|
|
@ -28,10 +28,13 @@ case object LogSize
|
|||
|
||||
class BankAccountActor extends Actor {
|
||||
makeTransactionRequired
|
||||
private val accountState =
|
||||
PersistentState.newMap(MongoStorageConfig())
|
||||
private val txnLog =
|
||||
PersistentState.newVector(MongoStorageConfig())
|
||||
|
||||
private var accountState: PersistentMap = _
|
||||
private var txnLog: PersistentVector = _
|
||||
override def initializeTransactionalState = {
|
||||
accountState = PersistentState.newMap(MongoStorageConfig())
|
||||
txnLog = PersistentState.newVector(MongoStorageConfig())
|
||||
}
|
||||
|
||||
def receive: PartialFunction[Any, Unit] = {
|
||||
// check balance
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue