close
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ class ActorRefSerializer(system: ExtendedActorSystem) extends Serializer[ActorRe
}

override def write(kryo: Kryo, output: Output, obj: ActorRef) = {
Serialization.currentTransportAddress.value match {
case null => output.writeString(obj.path.toString)
case addr => output.writeString(obj.path.toStringWithAddress(addr))
}
output.writeString(Serialization.serializedActorPath(obj))
}
}
18 changes: 18 additions & 0 deletions chill-akka/src/test/scala/com/twitter/chill/akka/AkkaTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,23 @@ class AkkaTests extends Specification {
val serializer = serialization.findSerializerFor((1,2,3))
serializer.getClass.equals(classOf[AkkaSerializer]) must beTrue
}

"be selected for ActorRef" in {
val serializer = serialization.findSerializerFor(system.actorFor("akka://test-system/test-actor"))
serializer.getClass.equals(classOf[AkkaSerializer]) must beTrue
}

"serialize and deserialize ActorRef successfully" in {
val actorRef = system.actorFor("akka://test-system/test-actor")

val serialized = serialization.serialize(actorRef)
serialized.isSuccess must beTrue

val deserialized = serialization.deserialize(serialized.get, classOf[ActorRef])
deserialized.isSuccess must beTrue

deserialized.get.equals(actorRef) must beTrue
}

}
}
2 changes: 1 addition & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ object ChillBuild extends Build {
case false => Seq()
case true => Seq(
"com.typesafe" % "config" % "0.3.1",
"com.typesafe.akka" %% "akka-actor" % "2.1.4"
"com.typesafe.akka" %% "akka-actor" % "2.2.1"
)
}
lazy val chillAkka = module("akka").settings(
Expand Down