Пример #1
0
 private bool Equals(SendToOneSubscriber other)
 {
     return(Equals(Message, other.Message));
 }
Пример #2
0
        private void PublishToEachGroup(string path, object message)
        {
            var prefix = path + "/";
            var lastKey = path + "0";   // '0' is the next char of '/'

            var groups = ExtractGroups(prefix, lastKey).GroupBy(kv => kv.Key);
            var wrappedMessage = new SendToOneSubscriber(message);

            foreach (var g in groups)
            {
                var routees = g.Select(r => r.Value).ToArray();
                if (routees.Length != 0)
                    new Router(_settings.RoutingLogic, routees).Route(wrappedMessage, Sender);
            }
        }