Example #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);
        }
Example #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));
 }
Example #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);
        }
Example #4
0
 public static UniTask Timeout(this UniTask task, TimeSpan timeout, CancellationTokenSource taskCancellationTokenSource = null)
 {
     return(Timeout(task.AsAsyncUnitUniTask(), timeout, taskCancellationTokenSource));
 }
Example #5
0
 public static UniTask WithCancellation(this UniTask task, CancellationToken cancellationToken, CancellationTokenSource taskCancellationTokenSource = null)
 {
     return(WithCancellation(task.AsAsyncUnitUniTask(), cancellationToken, taskCancellationTokenSource));
 }