Пример #1
0
        /// <summary>
        ///     Timeout with suppress OperationCanceledException. Returns (bool, IsCacneled).
        /// </summary>
        public static async UniTask <bool> TimeoutWithoutException(this UniTask task, TimeSpan timeout, bool ignoreTimeScale = true,
                                                                   PlayerLoopTiming timeoutCheckTiming = PlayerLoopTiming.Update, CancellationTokenSource taskCancellationTokenSource = null)
        {
            var v = await TimeoutWithoutException(task.AsAsyncUnitUniTask(), timeout, ignoreTimeScale, timeoutCheckTiming, taskCancellationTokenSource);

            return(v.IsTimeout);
        }
Пример #2
0
 public static UniTask Timeout(this UniTask task, TimeSpan timeout, bool ignoreTimeScale = true, PlayerLoopTiming timeoutCheckTiming = PlayerLoopTiming.Update,
                               CancellationTokenSource taskCancellationTokenSource       = null)
 {
     return(Timeout((UniTask)task.AsAsyncUnitUniTask(), timeout, ignoreTimeScale, timeoutCheckTiming, taskCancellationTokenSource));
 }
Пример #3
0
        public static async UniTask <bool> TimeoutWithoutException(this UniTask task, TimeSpan timeout, CancellationTokenSource taskCancellationTokenSource = null)
        {
            var v = await TimeoutWithoutException(task.AsAsyncUnitUniTask(), timeout, taskCancellationTokenSource);

            return(v.isTimeout);
        }
Пример #4
0
 public static UniTask Timeout(this UniTask task, TimeSpan timeout, CancellationTokenSource taskCancellationTokenSource = null)
 {
     return(Timeout(task.AsAsyncUnitUniTask(), timeout, taskCancellationTokenSource));
 }
Пример #5
0
 public static UniTask WithCancellation(this UniTask task, CancellationToken cancellationToken, CancellationTokenSource taskCancellationTokenSource = null)
 {
     return(WithCancellation(task.AsAsyncUnitUniTask(), cancellationToken, taskCancellationTokenSource));
 }