Re: [akka-user] How to Store the Message Object/Class to a database?

2014-05-29 Thread Konrad Malawski
Hello Allen,
have you had the chance to look into our akka-persistence
http://doc.akka.io/docs/akka/2.3.3/scala/persistence.html module?
Apps like you describe are very nicely modelled as events and “opposite
events” if you want to “undo”.

And direct answers to your questions:

   - path - the actor knows its full path via self.path ( see:
   http://doc.akka.io/api/akka/2.3.3/#akka.actor.ActorPath )
   - storage - well, the entire interwebs somehow store objects in
   databases :-) One way to go around this is some object to relational /
   document mapper. But in Akka’s case I would recommend using akka-peristence
   :-)

I hope this helps!
​
-- 
Cheers,
Konrad 'ktoso' Malawski
hAkker - Typesafe, Inc

http://scaladays.org

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] How to Store the Message Object/Class to a database?

2014-05-29 Thread Konrad 'ktoso' Malawski
Glad I could help! Happy hakking!
-- 
Konrad 'ktoso' Malawski
hAkker @ typesafe

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] How to Store the Message Object/Class to a database?

2014-05-27 Thread Allen Nie
Hi,

I encountered this problem while trying to write a program that has 
some sort of ability to undo its own action. I thought this data 
structure could do the trick: originalValue[String], changedValue[String], 
actorAddress[String], message[??]. Since Akka actor can send messages 
according to the URI, I imagine that I can create a RecoverActor that sends 
the original message with original value back to that Actor. Easy.

   However, I run into two problems shortly after. First one should be easy 
and is caused due to my inexperience with Akka framework: how does an actor 
know its own absolute URI? Second problem, all messages in Akka are either 
classes or objects. It's almost impossible to store such data type into a 
database and I even tried Redis (thought it could somehow magically allow 
me to do so). How can I possibly achieve this undo action?

I'm using Scala with Akka btw.

Any idea?

-- 
  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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.