Morning all,

I'm working on a system where we have a relativity small amount of very 
high performance flash storage and I would like to make the best use of it. 
Whats the best practice to stop a persistant actor and ensure its 
persistant state is deleted/removed entirely from storage?

Based on the documentation I have naive implementation in which a 
*DeleteCommand 
*invokes *deleteMessages() *and *deleteSnapshots()*, then sends itself a 
shutdown which stops itself. I can see from the source that *deleteMessages 
*and *deleteSnapshots *are async against the journal and snapshot store 
actors - so while they are being deleted I could still get messages that 
would persist new events and I might also get my shutdown command before 
have finished being deleted.
I could handle this by stashing until I get the *DeleteMessages *and 
*DeleteSnapshots 
*complete message, but I can see that PersistentActor makes use of stashing 
already and I don't want to introduce bugs.

Whats the best practice for this, am I over thinking, does Akka Persistence 
take care of this for me?

    case d: *DeleteCommand *=>
      *deleteMessages*(lastSequenceNr)
      *deleteSnapshots*(SnapshotSelectionCriteria())
      self ! *ShutdownCommand*

    case s: *ShutdownCommand *=>
      // looks racey to me
      context.stop(self)

Thanks
Ian

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to