Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import akka.persistence.common._
- import akka.persistence.redis._
- import akka.persistence.redis.RedisStorage._
- import akka.stm._
- import akka.actor.Actor
- import akka.actor.Actor._
- class Perman extends Actor {
- val msglog = RedisStorage.getVector("svd.log")
- def receive = {
- case msg: String =>
- atomic {
- msglog + msg.getBytes("UTF-8")
- }
- println(msglog.map(bytes => new String(bytes, "UTF-8")).toList)
- case _ =>
- }
- }
- object Test {
- def main(args: Array[String]): Unit = {
- val ref = actorOf[Perman].start
- ref ! "one"
- ref ! "two"
- }
- }
Add Comment
Please, Sign In to add comment