private void OnPaxosMessage(PaxosMessage msg) { foreach (var agent in agents) { agent.DispatchMessage(msg); } }
public void DispatchMessage(PaxosMessage result) { Action <object> value; if (registrations.TryGetValue(result.GetType(), out value) == false) { return; } value(result); }
protected Task SendAsync(Uri destination, PaxosMessage msg) { var channel = presence.GetNodeStateServiceAsync(destination); return(Task.Factory.FromAsync(channel.BeginReceivePaxosMessage, channel.EndReceivePaxosMessage, msg, null) .ContinueWith(task => { presence.CloseWcf(channel); if (task.Exception == null) { return; } // we accept the possibility of failure. presence.Log("Could not communicate with {0}, because: {1}", new object[] { destination, task.Exception }); })); }
public void ReceivePaxosMessage(PaxosMessage message) { onPaxosMessage(message); }