Broker Register(MessageUnit unit, Address address) { if (!units.ContainsKey(address)) { units.Add(address, new List<MessageUnit>()); unit.SetOutgoing(Outgoing); units[address].Add(unit); } return this; }
async Task Outgoing(TransportMessage message) { var address = message.Headers[AcceptanceTestHeaders.Destination].Parse(); IList<MessageUnit> destinations; if (!units.TryGetValue(address, out destinations)) { destinations = new MessageUnit[] { }; } foreach (MessageUnit unit in destinations) { await unit.HandOver(message) .ConfigureAwait(false); } }
public Broker Register(MessageUnit unit, Topic topic) { return Register(unit, (Address) topic); }
public Broker Register(MessageUnit unit) { return Register(unit, unit.Endpoint); }
public Broker Register(MessageUnit unit, Topic topic) { return(Register(unit, (Address)topic)); }
public Broker Register(MessageUnit unit) { return(Register(unit, unit.Endpoint)); }