예제 #1
0
 public override bool Invalidates(BroadcastableMessage other)
 {
     switch (other.Type)
     {
         case GossipMessageType.Alive:
             return ((AliveMessage)other).Name == Name;
         case GossipMessageType.Dead:
             return ((DeadMessage)other).Name == Name;
         default:
             return false;
     }
 }
예제 #2
0
        public override bool Invalidates(BroadcastableMessage other)
        {
            switch (other.Type)
            {
            case GossipMessageType.Alive:
                return(((AliveMessage)other).Name == Name);

            case GossipMessageType.Dead:
                return(((DeadMessage)other).Name == Name);

            default:
                return(false);
            }
        }
예제 #3
0
        public void Broadcast(BroadcastableMessage message, EventWaitHandle @event)
        {
            Debug.Assert(message != null);

            byte[] messageBytes;
            using (var ms = new MemoryStream())
            {
                _messageEncoder.Encode(message, ms);
                messageBytes = ms.ToArray();
            }

            var broadcast = new Broadcast(message, messageBytes, @event);
            _broadcasts.Enqueue(broadcast);
        }
예제 #4
0
 public Broadcast(BroadcastableMessage message, byte[] messageBytes, EventWaitHandle @event)
 {
     Message = message;
     MessageBytes = messageBytes;
     Event = @event;
 }
예제 #5
0
 public abstract bool Invalidates(BroadcastableMessage other);
예제 #6
0
 public abstract bool Invalidates(BroadcastableMessage other);