/// <summary> /// Queues given <see cref="AsyncJob" /> for execution by <see cref="AsyncJobScheduler" />. /// </summary> /// <param name="asyncJob"><see cref="AsyncJob" /> to execute.</param> /// <remarks> /// For performance reasons, the internal execution method utilizes ConfigureAwait(false). /// </remarks> public static void QueueAsyncJob(AsyncJob asyncJob) { if (AbortToken.IsCancellationRequested) { return; } OnJobQueued(asyncJob); Task.Run(() => ExecuteJob(asyncJob)); }
private static void OnJobFinished(AsyncJob args) { JobFinished?.Invoke(JobFinished, args); }
private static void OnJobStarted(AsyncJob args) { JobStarted?.Invoke(JobStarted, args); }