CoroutineContextStorage
class CoroutineContextStorage implements ContextStorageInterface, ExecutionContextAwareInterface
Store OpenTelemetry context in Hypervel's coroutine-local context.
Constants
| CONTEXT_KEY |
|
Properties
| protected ContextState | $mainState | ||
| protected ContextState | $fallbackState | ||
| protected array<int|ContextState> | $fallbackStates |
Methods
Create a coroutine context storage.
Snapshot the current context for another execution unit.
Switch to a registered fallback execution unit.
Forget a registered fallback execution unit.
Return the active scope.
Return the active context.
Attach a context to the current execution unit.
Return or create the current execution unit's state.
Return the current state without creating one.
Details
at line 32
__construct(ContextInterface $baseContext)
Create a coroutine context storage.
at line 40
void
fork(int|string $id)
Snapshot the current context for another execution unit.
at line 49
void
switch(int|string $id)
Switch to a registered fallback execution unit.
at line 64
void
destroy(int|string $id)
Forget a registered fallback execution unit.
at line 73
ContextStorageScopeInterface|null
scope()
Return the active scope.
at line 82
ContextInterface
current()
Return the active context.
at line 91
ContextStorageScopeInterface
attach(ContextInterface $context)
Attach a context to the current execution unit.
at line 106
bool
isActive(ContextState $state)
| internal |
Determine whether a scope's owning execution unit is active.
at line 114
protected ContextState
state()
Return or create the current execution unit's state.
at line 133
protected ContextState|null
existingState()
Return the current state without creating one.