Пример #1
0
 public static Task <T> OrTimeout <T>(this ValueTask <T> task, TimeSpan timeout, [CallerMemberName] string memberName = null, [CallerFilePath] string filePath = null, [CallerLineNumber] int?lineNumber = null) =>
 task.AsTask().OrTimeout(timeout, memberName, filePath, lineNumber);
Пример #2
0
 public static Task DefaultTimeout(this ValueTask task)
 {
     return(task.AsTask().TimeoutAfter(DefaultTimeoutTimeSpan));
 }
Пример #3
0
 public static Task OrTimeout(this ValueTask task, TimeSpan timeout, [CallerMemberName] string memberName = null, [CallerFilePath] string filePath = null, [CallerLineNumber] int?lineNumber = null)
 {
     return(task.AsTask().TimeoutAfter(timeout, filePath, lineNumber ?? 0));
 }
Пример #4
0
 public static Task <TResult> TimeoutAfter <TResult>(this ValueTask <TResult> task, TimeSpan timeout)
 => task.AsTask().TimeoutAfter(timeout);
Пример #5
0
 public static Task <TResult> TimeoutAfter <TResult>(this ValueTask <TResult> task, int millisecondsTimeout)
 => task.AsTask().TimeoutAfter(TimeSpan.FromMilliseconds(millisecondsTimeout));
Пример #6
0
 public static Task TimeoutAfter(this ValueTask task, TimeSpan timeout)
 => task.AsTask().TimeoutAfter(timeout);
Пример #7
0
 /// <summary>Schedules the continuation action for this TaskValue.</summary>
 public void OnCompleted(Action continuation)
 {
     _value.AsTask().ConfigureAwait(_continueOnCapturedContext).GetAwaiter().OnCompleted(continuation);
 }
 public static Task <T> DefaultTimeout <T>(this ValueTask <T> task)
 {
     return(task.AsTask().TimeoutAfter(TestConstants.DefaultTimeout));
 }