-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deadlocks and CancellationToken #44
Conversation
… the Hqub.MusicBrainz.API project.
Thanks. Could you explain the use case for |
Nevertheless it is good to have this opportunity, turning to the 3rd party can have unpredictable consequences. Also in my case, I need it. Who needs will can use, who does not - can ignore. |
Well, to extend an API just because it does no harm isn't a good argument.
Could you then please explain your use case? Using |
It is accepted that if an asynchronous operation can receive a token, it should be possible to transfer it, we cannot know how the library will be used, with what parameters and with what quality of the communication channel. Also, since this is a third party, we cannot know what problems are possible, anything happens. By default, the HttpClient timeout is 100 seconds and it is not subject to any significant problems, but the ability to cancel the operation or specify a different timeout, in my opinion, should be. I have no other weighty arguments. |
Fair enough! I'll leave this pending for a couple of days to see if there are any concerns. |
/// </summary> | ||
/// <param name="s">Source line.</param> | ||
/// <returns></returns> | ||
public static string Quote(this string s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the extension is not connected to the rest of the library, I would prefer this to be moved back to the example project.
Added ConfigureAwait(false) to prevent deadlocks.
Added CancelationToken to methods.
Please accept pull request.