internal async Task PushToProviderAsync(IBackgroundTaskScheduleProvider provider, string parentId) { var id = await provider.EnqueueChildAsync(this._taskEnvelope, parentId, this._option); if (this._children != null) { foreach (var child in this._children) { await child.PushToProviderAsync(provider, id); } } }
/// <summary> /// Initialises a new instance of the <see cref="BackgroundTaskScheduler" /> class. /// </summary> /// <param name="backgroundTaskPreprocessors">The registered background task preprocessors.</param> /// <param name="backgroundTaskScheduleProvider">The provider-specific implementation to delegate to.</param> /// <param name="logger">The logger for this class.</param> public BackgroundTaskScheduler( IEnumerable <IBackgroundTaskPreprocessor> backgroundTaskPreprocessors, IBackgroundTaskScheduleProvider backgroundTaskScheduleProvider, ILogger <BackgroundTaskScheduler> logger) { Guard.NotNull(nameof(backgroundTaskScheduleProvider), backgroundTaskScheduleProvider); Guard.NotNull(nameof(logger), logger); this._backgroundTaskScheduleProvider = backgroundTaskScheduleProvider; this._backgroundTaskPreprocessors = backgroundTaskPreprocessors; this._logger = logger; }
internal async Task PushToProviderAsync(IBackgroundTaskScheduleProvider provider) { string id; if (this._delay == null) { id = await provider.EnqueueAsync(this._taskEnvelope); } else { id = await provider.ScheduleAsync(this._taskEnvelope, this._delay.Value); } if (this._children != null) { foreach (var child in this._children) { await child.PushToProviderAsync(provider, id); } } }
/// <summary> /// Initialises a new instance of the <see cref="ApmBackgroundTaskScheduleProvider" /> class. /// </summary> /// <param name="innerProvider">The <see cref="IBackgroundTaskScheduleProvider" /> to wrap.</param> /// <param name="apmTool">The registered APM tool to enable cross-process tracing.</param> public ApmBackgroundTaskScheduleProvider(IBackgroundTaskScheduleProvider innerProvider, IApmTool apmTool) { this._innerProvider = innerProvider; this._apmTool = apmTool; }