示例#1
0
        protected override void OnMessageReceived(object sender, RedisMessageEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException(nameof(e));
            }

            switch (e.Channel)
            {
            case RedisMonitoringMessageBusChannels.TaskProcessorStateChannel:
                this.RaiseEventFromMessage <TaskProcessorStateEventArgs, Guid, TaskProcessorState>(e, this.StateChanged, (taskProcessorId, state) => new TaskProcessorStateEventArgs(taskProcessorId, state));
                break;

            case RedisMonitoringMessageBusChannels.PerformanceReportChannel:
                this.RaiseEventFromMessage <TaskProcessorPerformanceEventArgs, string>(e, this.PerformanceReportReceived, value => new TaskProcessorPerformanceEventArgs(RedisMessageBusReceiverBase.DeserializeTaskProcessorPerformanceInfo(value)));
                break;
            }
        }
示例#2
0
        /// <inheritdoc />
        public void NotifyPerformanceReport(TaskProcessorPerformanceReport performanceInfo)
        {
            if (performanceInfo == null)
            {
                throw new ArgumentNullException("performanceInfo");
            }

            Trace.WriteLine("ENTER: Notifying task processor '{0}' performance report ...".FormatInvariant(performanceInfo.TaskProcessorId));

            this.provider.PublishMessage(RedisMonitoringMessageBusChannels.PerformanceReportChannel, RedisMessageBusReceiverBase.SerializeTaskProcessorPerformanceInfo(performanceInfo));

            Trace.WriteLine("EXIT: Task processor '{0}' performance report notified.".FormatInvariant(performanceInfo.TaskProcessorId));
        }