Example #1
0
 /// <summary>
 /// Gets a concrete awaiter.
 /// </summary>
 /// <param name="awaitable">
 /// The awaitable.
 /// </param>
 /// <typeparam name="TResult">
 /// The type of the result of the task.
 /// </typeparam>
 /// <returns>
 /// The <see cref="AwaiterInterfaceWrapper{TResult}"/>.
 /// </returns>
 public static AwaiterInterfaceWrapper <TResult> GetAwaiter <TResult>(this ITask <TResult> awaitable)
 {
     return(new AwaiterInterfaceWrapper <TResult>(awaitable.CreateAwaiter()));
 }
Example #2
0
 /// <summary>
 /// Gets a concrete awaiter.
 /// </summary>
 /// <param name="awaitable">
 /// The awaitable.
 /// </param>
 /// <returns>
 /// The <see cref="AwaiterInterfaceWrapper"/>.
 /// </returns>
 /// <remarks>This method is intended for compiler user rather than use directly in code.</remarks>
 public static AwaiterInterfaceWrapper GetAwaiter(this ITask awaitable)
 {
     return(new AwaiterInterfaceWrapper(awaitable.CreateAwaiter()));
 }