public Publisher(PublisherSettings settings, IHandlerSource handlerSource, IDispatcher[] dispatchers) { if (settings == null) { throw new ArgumentNullException("settings"); } if (handlerSource == null) { throw new ArgumentNullException("handlerSource"); } if (dispatchers == null) { throw new ArgumentNullException("dispatchers"); } if (dispatchers.Any(x => ReferenceEquals(x, null))) { throw new ArgumentException("At least one of dispatches is null.", "dispatchers"); } _settings = settings; _handlerSource = handlerSource; _dispatchers = dispatchers; }
public virtual void RemoveSource(IHandlerSource handlerSource) { lock (_latch) { if (!_sources.Contains(handlerSource)) { return; } var newSources = _sources.Except(new[] {handlerSource}).ToArray(); Interlocked.Exchange(ref _sources, newSources); } }
public virtual void AddSource(IHandlerSource handlerSource) { lock (_latch) { if (_sources.Contains(handlerSource)) { return; } var newSources = new IHandlerSource[_sources.Length + 1]; _sources.CopyTo(newSources,0); newSources[_sources.Length] = handlerSource; Interlocked.Exchange(ref _sources, newSources); } }
public void Add(IHandlerSource source) { _handlers.HandlerSources.Add(source); }
public IHandlerSetup AddSource(IHandlerSource source) { Assert.ArgumentNotNull(source, nameof(source)); _sources.Add(source); return(this); }
public void FindBy(IHandlerSource source) { _parent.Config.Add(source); }
public void FindBy(IHandlerSource source) { _parent._sources.Add(source); }
public Publisher(IHandlerSource handlerSource, IDispatcher[] dispatchers) : this(PublisherSettings.Default, handlerSource, dispatchers) { }