Hello,
I'm using akka persistence and am serializing all of my events into JSON using the play-json library. For the most part this has been smooth sailing, however I can't seem to figure how to do this with ActorRef's - it may not be possible with how I'm trying to do it.
Here is what I have thus far:
implicit val actorRefFormat: Format[ActorRef] = new Format[ActorRef] {
def reads(json: JsValue): JsResult[ActorRef] = {
JsSuccess(Actor.noSender) // ???
}
def writes(o: ActorRef): JsValue = {
val identifier = Serialization.serializedActorPath(o)
Writes.StringWrites.writes(identifier)
}
}
It seems the `Writes` will work because it doesn't depend on having an `ActorSystem` in scope. How would I do this for the `Read`?
Thanks!
-Chris