示例#1
0
 /// <summary>
 /// Specifies to throw a <see cref="TaskCanceledException"/> after a specified amount of time, simulating a HTTP request timeout.
 /// </summary>
 /// <param name="responds"></param>
 /// <param name="timeoutAfterMilliseconds">The number of milliseconds after which the timeout occurs.</param>
 public static TResult TimesOutAfter <TResult>(this IResponds <TResult> responds, int timeoutAfterMilliseconds)
     where TResult : IResponseResult
 {
     return(responds.TimesOutAfter(TimeSpan.FromMilliseconds(timeoutAfterMilliseconds)));
 }
示例#2
0
 /// <summary>
 /// Specifies to throw a <see cref="TaskCanceledException"/> simulating a HTTP request timeout.
 /// </summary>
 /// <param name="responds"></param>
 public static TResult TimesOut <TResult>(this IResponds <TResult> responds)
     where TResult : IResponseResult
 {
     return(responds.TimesOutAfter(0));
 }