ErisApps / CatCore

A shared high-performance chat client library written in .NET Standard 2.0
GNU General Public License v3.0
29 stars 3 forks source link

Fixed CancellationToken not getting passed to the Polly policies #22

Closed ErisApps closed 2 years ago

ErisApps commented 2 years ago

This PR fixes the usage of CancellationTokens in the TwitchHelixApiService. CancellationTokens weren't passed to the Polly policies, but instead directly passed into the action that was executed by the policies. This has the side-effect that when a call is put on-hold by for example a retry policy, you'd have to wait till the policy actually retries before it can actually return. The change in this PR however, makes it return instantly instead.

Other than that, this PR also includes a breaking change by changing the nullable CancellationToken argument into non-nullable argument (with a fallback to the default value, which is CancellationToken.None)