Example #1
0
        /// <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));
        }
Example #2
0
 private static void OnJobFinished(AsyncJob args)
 {
     JobFinished?.Invoke(JobFinished, args);
 }
Example #3
0
 private static void OnJobStarted(AsyncJob args)
 {
     JobStarted?.Invoke(JobStarted, args);
 }