function ContextInterface::activate
Attaches this context as active context.
The returned scope has to be {@link ScopeInterface::detach()}ed. In most cases this should be done using a `try-finally` statement: ```php $scope = $context->activate(); try { // ... } finally { $scope->detach(); } ```
Return value
ScopeInterface scope to detach the context and restore the previous context
See also
https://github.com/open-telemetry/opentelemetry-specification/blob/main…
1 method overrides ContextInterface::activate()
- Context::activate in vendor/
open-telemetry/ context/ Context.php - Attaches this context as active context.
File
-
vendor/
open-telemetry/ context/ ContextInterface.php, line 52
Class
- ContextInterface
- Immutable execution scoped propagation mechanism.
Namespace
OpenTelemetry\ContextCode
public function activate() : ScopeInterface;