Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
BaggageScope class
- Package:
- @microsoft/agents-a365-observability
Context manager for baggage scope.
This class manages the lifecycle of baggage values, setting them on enter and restoring the previous context on exit.
Constructors
| BaggageScope(Map<string, string>) |
Methods
| dispose() | Manual cleanup alternative if caller isn't using |
| run<T>(() => T) | Execute a synchronous function under this baggage scope. Automatically restores previous context afterward. |
Constructor Details
BaggageScope(Map<string, string>)
new BaggageScope(pairs: Map<string, string>)
Parameters
- pairs
-
Map<string, string>
Method Details
dispose()
Manual cleanup alternative if caller isn't using using.
function dispose()
run<T>(() => T)
Execute a synchronous function under this baggage scope. Automatically restores previous context afterward.
function run<T>(fn: () => T): T
Parameters
- fn
-
() => T
Returns
T
