File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
openfeature/transaction_context Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ app = Flask(__name__)
259
259
api.set_transaction_context_propagator(ContextVarsTransactionContextPropagator())
260
260
261
261
# Middleware to set the transaction context
262
- # You can call api.set_transaction_context anywhere you have information,
262
+ # You can call api.set_transaction_context anywhere you have information,
263
263
# you want to have available in the code-paths below the current one.
264
264
@app.before_request
265
265
def set_request_transaction_context ():
@@ -269,7 +269,7 @@ def set_request_transaction_context():
269
269
api.set_transaction_context(evaluation_context)
270
270
271
271
def create_response () -> str :
272
- # This method can be anywhere in our code.
272
+ # This method can be anywhere in our code.
273
273
# The feature flag evaluation will automatically contain the transaction context merged with other context
274
274
new_response = api.get_client().get_string_value(" response-message" , " Hello User!" )
275
275
return f " Message from server: { new_response} "
Original file line number Diff line number Diff line change 1
- from abc import ABC , abstractmethod
1
+ import typing
2
+ from abc import abstractmethod
2
3
from typing import TypeVar
3
4
4
5
from openfeature .evaluation_context import EvaluationContext
5
6
6
7
T = TypeVar ("T" , bound = "TransactionContextPropagator" )
7
8
8
9
9
- class TransactionContextPropagator (ABC ):
10
+ class TransactionContextPropagator (typing . Protocol ):
10
11
@abstractmethod
11
12
def get_transaction_context (self ) -> EvaluationContext :
12
13
pass
You can’t perform that action at this time.
0 commit comments