Example #1
0
        private Broker Register(MessageUnit unit, Address address)
        {
            if (!this.units.ContainsKey(address))
            {
                this.units.Add(address, new List<MessageUnit>());

                unit.SetOutgoing(this.Outgoing);
                this.units[address].Add(unit);
            }

            return this;
        }
Example #2
0
        private async Task Outgoing(TransportMessage message)
        {
            var address = message.Headers[AcceptanceTestHeaders.Destination].Parse();

            IList<MessageUnit> destinations;
            if (!this.units.TryGetValue(address, out destinations))
            {
                destinations = new MessageUnit[] { };
            }

            foreach (MessageUnit unit in destinations)
            {
                await unit.HandOver(message)
                    .ConfigureAwait(false);
            }
        }
Example #3
0
 public Broker Register(MessageUnit unit, Topic topic)
 {
     return this.Register(unit, (Address)topic);
 }
Example #4
0
 public Broker Register(MessageUnit unit)
 {
     return this.Register(unit, unit.Endpoint);
 }
Example #5
0
 public Broker Register(MessageUnit unit, Topic topic)
 {
     return(this.Register(unit, (Address)topic));
 }
Example #6
0
 public Broker Register(MessageUnit unit)
 {
     return(this.Register(unit, unit.Endpoint));
 }