Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

StopAsync cancellationToken chaining #1016

Closed
Tratcher opened this issue Apr 12, 2017 · 2 comments
Closed

StopAsync cancellationToken chaining #1016

Tratcher opened this issue Apr 12, 2017 · 2 comments

Comments

@Tratcher
Copy link
Member

In https://github.com/aspnet/Hosting/pull/995/files we added IWebHost.StopAsync(CancellationToken) and an extension method StopAsync(). The extension method does not have access to the WebHostOptions to get the timeout, so it can only specify CancellationToken.None. In the real implementation we check if the token passed in can be cancelled, and if not then we create a new one using the timeout. This is not the most intuitive so I've filed this bug for followup design.

Prior art: HttpClient has a default timeout and SendAsync also accepts cancellationTokens. SendAsync creates a linked CTS using both the cancellationToken and the timeout.

@muratg
Copy link

muratg commented May 15, 2017

@glennc What are your thoughts on this?

@BrennanConroy
Copy link
Member

c7bac31

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants