summaryrefslogtreecommitdiff
path: root/vendor/opentracing/opentracing/src/OpenTracing/Scope.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/opentracing/opentracing/src/OpenTracing/Scope.php')
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/Scope.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/vendor/opentracing/opentracing/src/OpenTracing/Scope.php b/vendor/opentracing/opentracing/src/OpenTracing/Scope.php
new file mode 100644
index 000000000..174495434
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/Scope.php
@@ -0,0 +1,32 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+/**
+ * A {@link Scope} formalizes the activation and deactivation of a {@link Span}, usually from a CPU standpoint.
+ *
+ * Many times a {@link Span} will be extant (in that {@link Span#finish()} has not been called) despite being in a
+ * non-runnable state from a CPU/scheduler standpoint. For instance, a {@link Span} representing the client side of an
+ * RPC will be unfinished but blocked on IO while the RPC is still outstanding. A {@link Scope} defines when a given
+ * {@link Span} <em>is</em> scheduled and on the path.
+ */
+interface Scope
+{
+ /**
+ * Mark the end of the active period for the current thread and {@link Scope},
+ * updating the {@link ScopeManager#active()} in the process.
+ *
+ * NOTE: Calling {@link #close} more than once on a single {@link Scope} instance leads to undefined
+ * behavior.
+ *
+ * @return void
+ */
+ public function close(): void;
+
+ /**
+ * @return Span the {@link Span} that's been scoped by this {@link Scope}
+ */
+ public function getSpan(): Span;
+}