supabase-community / postgrest-csharp

A C# Client library for Postgrest
https://supabase-community.github.io/postgrest-csharp/api/Postgrest.html
MIT License
114 stars 22 forks source link

Added cancellation token support #47

Closed devpikachu closed 1 year ago

devpikachu commented 1 year ago

Added CancellationToken support as noted in #46

acupofjose commented 1 year ago

Great idea! Thank you for this. Code looks good to me, but could you add a test method to try against? If not, I can merge and add a case before the version bump this afternoon or tomorrow

devpikachu commented 1 year ago

Great idea! Thank you for this. Code looks good to me, but could you add a test method to try against? If not, I can merge and add a case before the version bump this afternoon or tomorrow

Sure thing! I'll add a test method and update the PR once done. 😄

devpikachu commented 1 year ago

@acupofjose I've added the mentioned test case for cancellation tokens. Do note that I've given the token source as low of TimeSpan as possible (1 tick), however, this still might be too slow in certain edge-cases, triggering a false-failed test.

If you know of a better way to reliably test cancellation tokens, please do let me know.

acupofjose commented 1 year ago

This is perfect, thanks for doing this so efficiently. That seems to be the best way I know of to test cancellation tokens! - I'll get put it (with credit) in the next release.

Implements #46