/// <summary> /// Initializes a new instance of the <see cref="NotificationsChannel"/> class. /// </summary> /// <param name="channelProvider">The instance for <see cref="IChannelProvider"/>.</param> /// <param name="logger">The logger.</param> /// <exception cref="ArgumentNullException">logger.</exception> public NotificationsChannel(IChannelProvider channelProvider, ILogger <NotificationsChannel> logger) { if (channelProvider == null) { throw new ArgumentNullException(nameof(channelProvider)); } this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); BoundedChannelOptions boundedChannelOptions = new BoundedChannelOptions(NotificationsChannel.ChannelCapacity) { SingleReader = false, SingleWriter = false, FullMode = BoundedChannelFullMode.DropWrite, }; this.channel = channelProvider.ProvisionBoundedChannel <WebNotification>(boundedChannelOptions); }