stormlog.phases.runtime
Runtime phase state tracking and boundary payload emission.
Classes
|
Structured boundary payload emitted into tracker telemetry events. |
|
A closeable tracker phase handle returned by |
Per-tracker phase nesting state and boundary payload generation. |
|
|
Opaque runtime token used for strict phase exit semantics. |
Exceptions
Raised when phase handles are closed incorrectly. |
- class stormlog.phases.runtime.PhaseBoundary(event_type, context, metadata, scope_id, path)[source]
Bases:
objectStructured boundary payload emitted into tracker telemetry events.
- Parameters:
event_type (str)
context (str)
metadata (dict[str, Any])
scope_id (str)
path (tuple[str, ...])
- event_type: str
- context: str
- metadata: dict[str, Any]
- scope_id: str
- path: tuple[str, ...]
- class stormlog.phases.runtime.PhaseHandle(*, scope_id, name, path, close_callback)[source]
Bases:
objectA closeable tracker phase handle returned by
enter_phase().- Parameters:
scope_id (str)
name (str)
path (tuple[str, ...])
close_callback (Callable[[], Any])
- property phase_path: str
Return the formatted phase path.
- property closed: bool
Return
Trueonce the handle has been closed.
- exception stormlog.phases.runtime.PhaseProtocolError[source]
Bases:
RuntimeErrorRaised when phase handles are closed incorrectly.
- class stormlog.phases.runtime.PhaseRecorder[source]
Bases:
objectPer-tracker phase nesting state and boundary payload generation.
- enter(*, session_id, rank, name, attrs=None)[source]
Primary runtime API returning both a token and the emitted boundary.
- Parameters:
session_id (str)
rank (int)
name (str)
attrs (Mapping[str, Any] | None)
- Return type:
tuple[PhaseToken, PhaseBoundary]
- enter_phase(*, session_id, rank, name, metadata=None)[source]
Register one nested phase enter transition.
- Parameters:
session_id (str)
rank (int)
name (str)
metadata (Mapping[str, Any] | None)
- Return type:
- exit(token)[source]
Primary runtime API for strict token-based exit.
- Parameters:
token (PhaseToken)
- Return type:
- class stormlog.phases.runtime.PhaseToken(scope_id, session_id, rank, thread_id, name)[source]
Bases:
objectOpaque runtime token used for strict phase exit semantics.
- Parameters:
scope_id (str)
session_id (str)
rank (int)
thread_id (int)
name (str)
- scope_id: str
- session_id: str
- rank: int
- thread_id: int
- name: str