Let's assume I have a chat application.

Client send message to chat which resulted in some command to some Actor. 
Now, I want to process what he wrote immediately and make it available to 
other users in this chat, so I process this command. At the same time I 
want to tell myself (an actor) that I need to store this message in chat 
history database BUT not right now. Save to the database should happen 
every 2 minutes. And if there was a crash I should be able to persist to 
the database anyway.

I assume workflow be like this:
1. User send a message
2. Chat room actor received a command with this message
3. We broadcast this message to everyone and add this message to some kind 
of queue to persist it to chat history database
4. Some persist command runs when 2 minute timeout has passed. It collects 
all incoming chat messages which hasn't been persisted yet in the order of 
their arrival
5. Run transaction with all messages and then remove them from the queue.
6. If there was a crash somewhere after 3 and messages wasn't persisted, 
then I should try to persist them again. If they was persisted I should 
NEVER try to persist them again.

How to construct something like this in Akka? Which features should I 
use/which patterns?

-- 
>>>>>>>>>>      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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to