You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 20, 2018. It is now read-only.
There are several async APIs in the feature interfaces or on HttpContext that developers may want granular timeout/cancellation support for. Especially anything that can trigger network IO.
C# won't allow CancellationToken.None as an optional param, optional params must be compile time constants. I've added an overload in the relevant cases.
Actually you can with default(CancellationToken) - see the engineering doc.
Relevant section:
Async method patterns
By default all async methods must have the Async suffix. There are some exceptional circumstances where a method name from a previous framework will be grandfathered in.
Passing cancellation tokens is done with an optional parameter with a value of default(CancellationToken), which is equivalent to CancellationToken.None (one of the few places that we use optional parameters). The main exception to this is in web scenarios where there is already an HttpContext being passed around, in which case the context has its own cancellation token that can be used when needed.
Sample async method:
There are several async APIs in the feature interfaces or on HttpContext that developers may want granular timeout/cancellation support for. Especially anything that can trigger network IO.
The text was updated successfully, but these errors were encountered: