-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Check for empty message in Envelope class #2210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
var manifestSerializer = serializer as SerializerWithStringManifest; | ||
if (manifestSerializer != null) | ||
{ | ||
var manifest = manifestSerializer.Manifest(serialized); | ||
message = _systemImpl.Serialization.Deserialize(serialized, manifestSerializer.Identifier, manifest); | ||
message = new Envelope(_systemImpl.Serialization.Deserialize(serialized, manifestSerializer.Identifier, manifest), message.Sender); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scala version has a bit different implementation
https://github.com/akka/akka/blob/4acc1cca6a27be0ff80f801de3640f91343dce94/akka-actor/src/main/scala/akka/actor/dungeon/Dispatch.scala#L138
I should check for null, and then throw an exception
@@ -101,6 +101,7 @@ namespace Akka.Actor | |||
public void ReserveChild(string name) { } | |||
public void Restart(System.Exception cause) { } | |||
public void Resume(System.Exception causedByFailure) { } | |||
public virtual void SendMessage(Akka.Actor.Envelope message) { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? Why not have the other SendMessage
method construct the envelope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did the same what Akka JVM has
@@ -296,7 +296,7 @@ public void UseThreadContext(Action action) | |||
} | |||
} | |||
|
|||
public virtual void SendMessage(IActorRef sender, object message) | |||
public virtual void SendMessage(Envelope message) | |||
{ | |||
if (Mailbox == null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is that? Akka JVM doesn't have this check
{ | ||
var manifest = manifestSerializer.Manifest(unwrapped); | ||
var deserialized = _systemImpl.Serialization.Deserialize(serialized, serializer.Identifier, manifest); | ||
message = new Envelope(deserialized, message.Sender); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests don't work without this. But scala code doesn't have this assignment
I've also removed all getters in the properties