April 2013
Intermediate to advanced
1700 pages
92h 51m
English
Anonymous methods using the delegate keyword or using lambda expression notification can also be marked with the async modifier. A good example of the use of this is when calling Task.Run, to start work on the task pool. A couple of overloads of this method are shown here:
public static Task Run(Action action);public static Task<TResult> Run<TResult>(Func<Task<TResult>> function);public static Task Run(Func<Task> function);public static Task<TResult> Run<TResult>(Func<TResult> function);
Additional overloads provide a CancellationToken parameter. Notice how the function and action parameter delegate types all conform to valid asynchronous method signatures. In particular, the Action ...
Read now
Unlock full access