XeroAPI / Xero-NetStandard

A wrapper of the Xero API in the .NetStandard 2.0 framework. Supports Accounting, Payroll AU/US, and Files
MIT License
127 stars 124 forks source link

CancellationToken #316

Closed joyhguan closed 1 year ago

joyhguan commented 3 years ago

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

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);

:(

jenksguo commented 3 years ago

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?

JRising-Xero commented 1 year ago

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

joyhguan commented 1 year ago

Yay!!!!