open-feature / dotnet-sdk

.NET implementation of the OpenFeature SDK
https://openfeature.dev
Apache License 2.0
61 stars 17 forks source link

feat!: add CancellationTokens, ValueTasks hooks #268

Closed toddbaert closed 2 months ago

toddbaert commented 3 months ago

This PR is a combination of https://github.com/open-feature/dotnet-sdk/pull/184 and https://github.com/open-feature/dotnet-sdk/pull/185. Changes include:

UPDATE:

After chewing on this for a night, I'm starting to feel:

toddbaert commented 3 months ago

After chewing on this for a night, I'm starting to feel:

toddbaert commented 3 months ago

I think that we should probably have tests which have a dummy async provider that blocks evaluations until cancelled, then we should start an evaluation and cancel it to make sure all the steps happen. Maybe something similar with a hook implementation.

That's a good idea. Will add.

toddbaert commented 3 months ago

I think that we should probably have tests which have a dummy async provider that blocks evaluations until cancelled, then we should start an evaluation and cancel it to make sure all the steps happen. Maybe something similar with a hook implementation.

That's a good idea. Will add.

I've added tests for cancellation (evaluation/resolution and hooks): https://github.com/open-feature/dotnet-sdk/pull/268/commits/036d7a45c5627c4fb17ce7ab7208cd52ca19b7ca