protected virtual Task OnEnqueuedAsync(IQueueEntry <T> entry) { var args = new EnqueuedEventArgs <T> { Queue = this, Entry = entry }; return(Enqueued?.InvokeAsync(this, args) ?? Task.CompletedTask); }
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(); }
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); }
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(); }
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(); }
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)); }
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)); }
protected virtual Task OnEnqueued(object sender, EnqueuedEventArgs <T> enqueuedEventArgs) { return(TaskHelper.Completed()); }