-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Implement transaction context #312
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #312 +/- ##
==========================================
+ Coverage 85.30% 85.67% +0.36%
==========================================
Files 36 38 +2
Lines 1477 1515 +38
Branches 150 153 +3
==========================================
+ Hits 1260 1298 +38
Misses 187 187
Partials 30 30 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice start! Left some thoughts and references to how we are doing it in the other languages.
Thanks for the review @lukas-reining. I based the implementation on the JS client. I'll look into more detail on the Java version instead. |
35b90bf
to
9158a92
Compare
a0a7f36
to
c471c06
Compare
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
Transaction Context
This pull request introduces transaction context propagation to the OpenFeature library. The changes include adding a new interface for transaction context propagation, implementing a no-op and an AsyncLocal-based propagator, and updating the API to support these propagators.
Related Issues
Fixes #243
Notes
Transaction Context Propagation:
src/OpenFeature/Api.cs
: Added a private field_transactionContextPropagator
and a lock for thread safety. Introduced methods to get and set the transaction context propagator, and to manage the transaction context using the propagator. [1] [2]src/OpenFeature/AsyncLocalTransactionContextPropagator.cs
: Implemented theAsyncLocalTransactionContextPropagator
class that usesAsyncLocal<T>
to store the transaction context.src/OpenFeature/NoOpTransactionContextPropagator.cs
: Implemented a no-op version of theITransactionContextPropagator
interface.src/OpenFeature/Model/ITransactionContextPropagator.cs
: Defined theITransactionContextPropagator
interface responsible for persisting transaction contexts.API Enhancements:
src/OpenFeature/Api.cs
: Updated theShutdownAsync
method to reset the transaction context propagator.src/OpenFeature/OpenFeatureClient.cs
: Modified theEvaluateFlagAsync
method to merge the transaction context with the evaluation context.