scala - Why method persist of PersistentActor doesn't return a Future? -


i have theoretical question. wrote code:

class account extends persistentactor {     def receivecommand = {         case block(id, amount) => persist(block(id, amount)){             case block(id, amount) =>                 persist(revertblock(id, s"id ${id} in processing",                    balance + amount))(_.revert())         }     }     ... } 

it looks bad. why method persist takes callback 2nd argument instead return future?

deal in context. sender() inside callback valid, not true futures.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -