diff options
author | Andrew Dolgov <[email protected]> | 2023-10-20 17:12:29 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2023-10-20 21:13:39 +0300 |
commit | cdd7ad020e165fe680703b6d3319b908b682fb7a (patch) | |
tree | b51eb09b7b4587e8fbc5624ac8d88d28cfcd0b04 /vendor/open-telemetry/context/ImplicitContextKeyedInterface.php | |
parent | 45a9ff0c88cbd33892ff16ab837e9059937d656e (diff) |
jaeger-client -> opentelemetry
Diffstat (limited to 'vendor/open-telemetry/context/ImplicitContextKeyedInterface.php')
-rw-r--r-- | vendor/open-telemetry/context/ImplicitContextKeyedInterface.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/vendor/open-telemetry/context/ImplicitContextKeyedInterface.php b/vendor/open-telemetry/context/ImplicitContextKeyedInterface.php new file mode 100644 index 000000000..0af93122c --- /dev/null +++ b/vendor/open-telemetry/context/ImplicitContextKeyedInterface.php @@ -0,0 +1,32 @@ +<?php + +declare(strict_types=1); + +namespace OpenTelemetry\Context; + +/** + * Represents a value that can be stored within {@see ContextInterface}. + * Allows storing themselves without exposing a {@see ContextKeyInterface}. + * + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/trace/api.md#context-interaction + * @see https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/baggage/api.md#context-interaction + */ +interface ImplicitContextKeyedInterface +{ + /** + * Adds `$this` to the {@see Context::getCurrent() current context} and makes + * the new {@see Context} the current context. + * + * {@see ScopeInterface::detach()} _MUST_ be called to properly restore the previous context. + * + * This method is equivalent to `Context::getCurrent().with($value).activate();`. + * + * @todo: Update this to suggest using the new helper method way to doing something in a specific context/span. + */ + public function activate(): ScopeInterface; + + /** + * Returns a new {@see ContextInterface} created by setting `$this` into the provided [@see ContextInterface}. + */ + public function storeInContext(ContextInterface $context): ContextInterface; +} |