/// <summary> /// Initializes a new instance of the <see cref="RedisMessageBusReceiverBase"/> class. /// </summary> /// <param name="provider">The Redis provider to use.</param> /// <exception cref="ArgumentNullException">Parameter <paramref name="provider"/> is null.</exception> protected RedisMessageBusReceiverBase(IRedisProvider provider) { this.debugName = this.GetType().Name; Trace.WriteLine("ENTER: Constructing {0} ...".FormatInvariant(this.debugName)); if (provider == null) { throw new ArgumentNullException("provider"); } this.provider = provider; this.subscription = provider.CreateSubscription(); this.subscription.MessageReceived += this.OnMessageReceived; Trace.WriteLine("EXIT: {0} constructed.".FormatInvariant(this.debugName)); }
/// <summary> /// Initializes a new instance of the <see cref="RedisTaskProcessorMessageQueue"/> class. /// </summary> /// <param name="provider">The Redis provider to use.</param> /// <param name="serializer">The serializer to use for master commands serialization.</param> public RedisTaskProcessorMessageQueue(IRedisProvider provider, IEntityBinarySerializer serializer) { Trace.WriteLine("ENTER: Constructing {0} ...".FormatInvariant(this.debugName)); if (provider == null) { throw new ArgumentNullException(nameof(provider)); } if (serializer == null) { throw new ArgumentNullException(nameof(serializer)); } this.provider = provider; this.serializer = serializer; this.subscription = provider.CreateSubscription(); this.subscription.MessageReceived += this.OnMessageReceived; Trace.WriteLine("EXIT: {0} constructed.".FormatInvariant(this.debugName)); }