Add cancellation token parameter to async methods #549
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CancellationToken
to all the async public methodsFew notes:
I have removed one of the PUT definition defined under the
IOctopusAsyncClient
because after adding the optionalCancellationToken
it resulted in ambiguous calls betweenPUT(string path, TResource resourse, CancellationToken token = default))
andPUT(string path, TResource resourse, object pathParameters = null, CancellationToken token = default))
. Therefore removed the former one and keeping the later. Everything should work just fine for PUTs in IOctopusAsyncClient.86e2f6b#diff-2c952992d6d1233543cc4f2e60805c56L248
The GETs here are taking CancellationToken as first parameter rather as the last being last in the list because of the
params
parameter array limitation. Not really sure on how to go about this one, maybe we don't support CancellationToken for these GET calls :/ ? ... Because this might potentially break public code, since it requires the calls to be made as named parameter unless users pass in the cancellation token as the first paramter:https://github.com/OctopusDeploy/OctopusClients/pull/549/files#diff-847456346808210c60e2f723afc5ebedR32
https://github.com/OctopusDeploy/OctopusClients/pull/549/files#diff-6afea74a6e0295e940e3811d8b8a565aR232
https://github.com/OctopusDeploy/OctopusClients/pull/549/files#diff-4c263f6d32ae87b4ba88412ad4a3e175R11
closes #537