dependabot-preview[bot] on nuget
Bump System.Configuration.Confi… (compare)
dependabot-preview[bot] on nuget
Bump NUnit from 3.7.1 to 3.13.0… (compare)
Aaronontheweb on dev
close #4454 - added full ASP.NE… (compare)
Thread.Interrupt
call we make on one of the specs caused the XUnit test runner to blow up
I am not sure if this is a bug or not, or if this should be posted here or not, but here it goes...
I am using Akka.NET remoting, I have one "client" and one "server" application (I know akka doesn't distinguish between them) and I wanted to receive some entity (called History) from the server.
The class I was sending from the server has an IReadOnlyCollection of one of my custom entities (conveniently called Entity).
Now the Entity class had 2 constructors, first of which took a string and parsed it into a DateTime object, and the second which took a DateTime object.
However, when I tried to send this History from the server to the client I would get a disassociated exception.
Looking into it, I first commented out the construct that takes the DateTime object. However, when the other constructor was invoked, the string paramater (which I would like to parse to a DateTime) was equal to null.
Commenting out the constructor that takes a string and tries to parse it into a DateTime, I was left with only the second constructor which takes a DateTime object. This worked.
But I don't know why exactly it didn't work when I had both constructors, or why the string parameter was equal to null.
I can send or link the file with all of the classes if it could help.
Sorry if I am/was unclear.
public static class SerializerTestHelpers
{
public static async Task<T> AkkaSerialized<T>(this T src)
{
var hokon = "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));
}
}
@DamianReeves in Akka (and other message based models) it's easier to define a contract on message level, i.e:
interface IMyProtocolMessage {}
sealed class MyMessage1 : IMyProtocolMessage {}
sealed class MyMessage2 : IMyProtocolMessage {}
Unlike method calls, messages are composable. You can wrap one message with another, batch them, redirect or persist if necessary. Also, you can define dynamic interfaces (through Become) with that.
For type safety it's possible to wrap IActorRef
s with typed version (think IActorRef<IMyProtocolMessage>
) - I've made this a default in Akkling.