Created
September 15, 2016 12:46
-
-
Save Danthar/8d8b9900f991024209972dc387b2f76d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class SerializerTestHelpers | |
{ | |
public static async Task<T> AkkaSerialized<T>(this T src) | |
{ | |
var hocon = "akka.actor.provider = \"Akka.Remote.RemoteActorRefProvider, Akka.Remote\"" + | |
Environment.NewLine + | |
"akka.remote.helios.tcp.port = 0" + Environment.NewLine + | |
"akka.remote.helios.tcp.hostname = localhost"; | |
var sys = ActorSystem.Create("src");//, ConfigurationFactory.ParseString(hokon)); | |
await sys.Terminate(); | |
var ser = sys.Serialization.FindSerializerFor(src); | |
var bin = ser.ToBinary(src); | |
return (T)ser.FromBinary(bin, typeof(T)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment