public void Handle(JoinNetwork message)
            {
                _node.Log($"{message.TypeName()} From:{message.From}");
                _commMgr.SendAck(message, message.CorrelationId);

                var routingCorrelation   = GetNextCorrelation();
                var successorCorrelation = GetNextCorrelation();

                var joinNetworkReply = new JoinNetworkReply(_node.Identity, message.From, message.CorrelationId);

                var multiReplyHandler = _node.CreateAwaitAllResponsesHandler();

                multiReplyHandler
                .PerformAction(() =>
                {
                    GetSuccessorTable(successorCorrelation, message.From);
                    //GetRoutingTable(routingCorrelation, message.From, message.RoutingTable);
                })
                .AndAwait(successorCorrelation, (GetSuccessorTableReply successorTableReply) =>
                {
                    _commMgr.SendAck(message, message.CorrelationId);
                    joinNetworkReply.SuccessorTable = successorTableReply.SuccessorTable;
                })
                //.AndAwait(routingCorrelation, (GetRoutingTableReply routingTableReply) =>
                //{
                //    _commMgr.SendAck(message, message.CorrelationId);
                //    joinNetworkReply.RoutingTable = routingTableReply.RoutingTable;
                //})
                .ContinueWith(() =>
                {
                    _commMgr.Send(joinNetworkReply);
                })
                .Run(message.CorrelationId);
            }
            public void Handle(Stabilize message)
            {
                _node.LogMessage(message);
                _commMgr.SendAck(message, message.CorrelationId);

                var reply = new StabilizeReply(_node.Identity, message.From, message.CorrelationId)
                {
                    Predecessor = _node.Predecessor,
                    // Take the opportunity to ensure the successor table is up to date.
                    SuccessorTableEntries = _node.SuccessorTable.Entries,
                };

                _node.Log($"Sending {reply.TypeName()} Id:{reply.CorrelationId}");
                _commMgr.Send(reply);
            }
            public void Handle(Notify message)
            {
                _node.Log($"{message.TypeName()} From:{message.From}");
                _commMgr.SendAck(message, message.CorrelationId);

                // Let the predecessor know to join to the specified successor.
                // And adjust successor table accordingly.
                var entries = _node.SuccessorTable.Entries;

                for (int i = 1; i < entries.Length; ++i)
                {
                    entries[i] = entries[i - 1];
                }
                var successor = message.NewSuccessor;

                entries[0] = new RoutingTableEntry(successor.RoutingHash, successor);

                _node.Log($"Changed successor to {successor}");
                _commMgr.Send(new NotifyReply(_node.Identity, message.From, message.CorrelationId));
            }