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