Ejemplo n.º 1
0
        protected override void OnReceive(object message)
        {
            var up = message as ClusterEvent.MemberUp;

            if (up != null)
            {
                var mem = up;
                Log.Info("Member is Up: {0}", mem.Member);

                NodeService.Add(mem.Member.UniqueAddress);
            }
            else if (message is ClusterEvent.UnreachableMember)
            {
                var unreachable = (ClusterEvent.UnreachableMember)message;
                Log.Info("Member detected as unreachable: {0}", unreachable.Member);
            }
            else if (message is ClusterEvent.MemberRemoved)
            {
                var removed = (ClusterEvent.MemberRemoved)message;
                Log.Info("Member is Removed: {0}", removed.Member);
            }
            else if (message is ClusterEvent.IMemberEvent)
            {
                //IGNORE
            }
            else
            {
                Unhandled(message);
            }
        }