File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
openfeature/transaction_context Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ app = Flask(__name__)
259259api.set_transaction_context_propagator(ContextVarsTransactionContextPropagator())
260260
261261# 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,
263263# you want to have available in the code-paths below the current one.
264264@app.before_request
265265def set_request_transaction_context ():
@@ -269,7 +269,7 @@ def set_request_transaction_context():
269269 api.set_transaction_context(evaluation_context)
270270
271271def create_response () -> str :
272- # This method can be anywhere in our code.
272+ # This method can be anywhere in our code.
273273 # The feature flag evaluation will automatically contain the transaction context merged with other context
274274 new_response = api.get_client().get_string_value(" response-message" , " Hello User!" )
275275 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
22from typing import TypeVar
33
44from openfeature .evaluation_context import EvaluationContext
55
66T = TypeVar ("T" , bound = "TransactionContextPropagator" )
77
88
9- class TransactionContextPropagator (ABC ):
10- @abstractmethod
11- def get_transaction_context (self ) -> EvaluationContext :
12- pass
9+ class TransactionContextPropagator (typing .Protocol ):
10+ def get_transaction_context (self ) -> EvaluationContext : ...
1311
14- @ abstractmethod
15- def set_transaction_context ( self , transaction_context : EvaluationContext ) -> None :
16- pass
12+ def set_transaction_context (
13+ self , transaction_context : EvaluationContext
14+ ) -> None : ...
You can’t perform that action at this time.
0 commit comments