示例#1
0
 public SubscriberId(string channel, string topic, Func <Envelope, bool> condition, IChannelTopicMatcher matcher)
 {
     this._id        = Guid.NewGuid();
     this._channel   = channel;
     this._topic     = topic;
     this._matcher   = matcher;
     this._condition = condition;
 }
示例#2
0
            public Condition(string channel, string topic, Func <Envelope, bool> condition, IChannelTopicMatcher matcher)
            {
                this._matcher = matcher;
                this._channel = channel;
                this._topic   = topic;

                if (condition == null)
                {
                    condition = (env) => true;
                }

                this._condition = condition;
            }
示例#3
0
        public CompositionBox(IBox box, IChannelTopicMatcher matcher = null)
        {
            if (box == null)
            {
                throw new ArgumentNullException(nameof(box));
            }

            this._box = box;

            if (matcher == null)
            {
                if (box is IChannelTopicMatcherProvider)
                {
                    matcher = (box as IChannelTopicMatcherProvider).Matcher;
                }
            }

            this._matcher      = matcher ?? WildcardChannelTopicMatcher.Instance;
            this._subscription = this._box.Subscribe(Postal.All, Postal.All, this.OnReceive);
        }