コード例 #1
0
        protected virtual Task OnEnqueuedAsync(IQueueEntry <T> entry)
        {
            var args = new EnqueuedEventArgs <T> {
                Queue = this, Entry = entry
            };

            return(Enqueued?.InvokeAsync(this, args) ?? Task.CompletedTask);
        }
コード例 #2
0
        protected override async Task OnEnqueued(object sender, EnqueuedEventArgs <T> enqueuedEventArgs)
        {
            _timer.ScheduleNext(SystemClock.UtcNow.Add(_reportInterval));

            string subMetricName = GetSubMetricName(enqueuedEventArgs.Entry.Value);

            if (!String.IsNullOrEmpty(subMetricName))
            {
                await _metricsClient.CounterAsync(GetFullMetricName(subMetricName, "enqueued")).AnyContext();
            }

            await _metricsClient.CounterAsync(GetFullMetricName("enqueued")).AnyContext();
        }
コード例 #3
0
        protected override Task OnEnqueued(object sender, EnqueuedEventArgs <T> enqueuedEventArgs)
        {
            _timer.ScheduleNext(SystemClock.UtcNow.Add(_reportInterval));

            string subMetricName = GetSubMetricName(enqueuedEventArgs.Entry.Value);

            if (!String.IsNullOrEmpty(subMetricName))
            {
                _metricsClient.Counter(GetFullMetricName(subMetricName, "enqueued"));
            }

            _metricsClient.Counter(GetFullMetricName("enqueued"));
            return(Task.CompletedTask);
        }
コード例 #4
0
        protected override async Task OnEnqueued(object sender, EnqueuedEventArgs <T> enqueuedEventArgs)
        {
            await base.OnEnqueued(sender, enqueuedEventArgs).AnyContext();

            await ReportQueueCountAsync().AnyContext();

            string customMetricName = GetCustomMetricName(enqueuedEventArgs.Data);

            if (!String.IsNullOrEmpty(customMetricName))
            {
                await _metricsClient.CounterAsync(GetFullMetricName(customMetricName, "enqueued")).AnyContext();
            }
            await _metricsClient.CounterAsync(GetFullMetricName("enqueued")).AnyContext();
        }
コード例 #5
0
        protected override async Task OnEnqueued(object sender, EnqueuedEventArgs <T> enqueuedEventArgs)
        {
            await base.OnEnqueued(sender, enqueuedEventArgs).AnyContext();

            _timer.ScheduleNext();

            string customMetricName = GetCustomMetricName(enqueuedEventArgs.Entry.Value);

            if (!String.IsNullOrEmpty(customMetricName))
            {
                await _metricsClient.CounterAsync(GetFullMetricName(customMetricName, "enqueued")).AnyContext();
            }

            await _metricsClient.CounterAsync(GetFullMetricName("enqueued")).AnyContext();
        }
コード例 #6
0
ファイル: QueueBase.cs プロジェクト: nj/Foundatio
        protected virtual Task OnEnqueuedAsync(IQueueEntry <T> entry)
        {
            var enqueued = Enqueued;

            if (enqueued == null)
            {
                return(Task.CompletedTask);
            }

            var args = new EnqueuedEventArgs <T> {
                Queue = this, Entry = entry
            };

            return(enqueued.InvokeAsync(this, args));
        }
コード例 #7
0
        protected virtual Task OnEnqueuedAsync(IQueueEntry <T> entry)
        {
            LastEnqueueActivity = SystemClock.UtcNow;

            var enqueued = Enqueued;

            if (enqueued == null)
            {
                return(Task.CompletedTask);
            }

            var args = new EnqueuedEventArgs <T> {
                Queue = this, Entry = entry
            };

            return(enqueued.InvokeAsync(this, args));
        }
コード例 #8
0
ファイル: QueueBehaviour.cs プロジェクト: derekpitt/Foundatio
 protected virtual Task OnEnqueued(object sender, EnqueuedEventArgs <T> enqueuedEventArgs)
 {
     return(TaskHelper.Completed());
 }