Xero-NetStandard icon indicating copy to clipboard operation
Xero-NetStandard copied to clipboard

CancellationToken

Open joyhguan opened this issue 5 years ago • 1 comments

SDK you're using (please complete the following information):

  • Version [e.g. whatever the latest version on nuget]

Is your feature request related to a problem? Please describe. Yes...This is no CancellationToken so even if an operation is cancelled the app will still wait xero api to return :(

Describe the solution you'd like Add CancellationToken as an argument and also use it in ApiClient change your SDK code from

var response = await client.ExecuteAsync<T>(req);

to be something like

var response = await client.ExecuteAsync<T>(req, cancellationToken);

:(

joyhguan avatar Feb 08 '21 23:02 joyhguan

Hey @joyhguan we would like to follow your advice to add this cancellationToken in. However, I am a bit stuck on getting am example to work as a test. Could you please share an implementation example? e.g. start an Async API method and cancel it?

jenksguo avatar Mar 29 '21 03:03 jenksguo

Cancellation tokens have now been added to all async methods with the 3.31.0 SDK release.

JRising-Xero avatar Dec 14 '22 23:12 JRising-Xero

Yay!!!!

joyhguan avatar Dec 14 '22 23:12 joyhguan