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
Post a Comment