public void Update(VCActor sender, VCActor receiver, VCMessage message, string user) { Sender = sender; Receiver = receiver; Message = message; User = user; }
public VectorClock() { Sender = null; Receiver = null; Message = new VCMessage(); Clock = new VCClock(); User = null; }
void ReleaseDesignerOutlets() { if (VCMessage != null) { VCMessage.Dispose(); VCMessage = null; } if (VCUserIdentity != null) { VCUserIdentity.Dispose(); VCUserIdentity = null; } }
public void Enqueue(IActorRef receiver, Envelope envelope) { VCMessage message = GetMessage(envelope); VCActor senderActor = new VCActor(envelope.Sender.Path.ToString(), GetActorType(envelope.Sender)); VCActor receiverActor = new VCActor(receiver.Path.ToString(), GetActorType(receiver)); OnSend(receiverActor, senderActor, message); OnReceive(receiverActor, senderActor, message); SendToAPI(); _messageQueue.Enqueue(receiver, envelope); }
private void OnSend(VCActor receiver, VCActor sender, VCMessage message) { _clock_sender = VectorClockHelper.GetVectorClock(sender.Path.ToString()); _clock_sender.Update( sender, receiver, message, GetUser() ); _clock_sender.Tick(sender.Path.ToString()); VectorClockHelper.Update(sender.Path.ToString(), _clock_sender); }
private VCMessage GetMessage(Envelope envelope) { VCMessage message = new VCMessage(envelope.Message.GetType().Name); var props = envelope.Message.GetType().GetProperties(); foreach (var prop in props) { try { var value = envelope.Message.GetType().GetProperty(prop.Name).GetValue(envelope.Message); if (value == null) { throw new Exception(); } message.AddProp(prop.Name, value.ToString()); } catch { message.AddProp(prop.Name, ""); } } return(message); }