Exemple #1
0
        /// <inheritdoc />
        public void NotifyMasterModeChanged(Guid taskProcessorId, bool isMaster, MasterModeChangeReason reason)
        {
            Trace.WriteLine("ENTER: Notifying task processor '{0}' master mode changed to {1} with reason {2} ...".FormatInvariant(taskProcessorId, isMaster, reason));

            MasterModeChangeEventArgs.ValidateArguments(isMaster, reason);

            this.provider.PublishMessage(RedisTaskProcessorChannels.MasterModeChangedChannel, RedisConverter.ToString(taskProcessorId, isMaster, reason));

            Trace.WriteLine("EXIT: Task processor '{0}' master mode changed to {1} with reason {2} notified.".FormatInvariant(taskProcessorId, isMaster, reason));
        }
        public void NotifyMasterModeChanged(Guid taskProcessorId, bool isMaster, MasterModeChangeReason reason)
        {
            this.RecordMethodCall(taskProcessorId, isMaster, reason);

            MasterModeChangeEventArgs.ValidateArguments(isMaster, reason);

            if ((this.MasterModeChanged != null) && this.SubscribedChannels.Contains(MessageBusChannel.MasterModeChanged))
            {
                this.MasterModeChanged(this, new MasterModeChangeEventArgs(taskProcessorId, isMaster, reason));
            }
        }