yera.runtime.replay_executor
Replay a stored session through the normal runtime event boundary.
Replay republishes recorded output events in their original order. At each recorded input event it pauses and requires the live caller to submit the same typed response before continuing. This recreates the session transcript without executing the original app.
Symbols
ReplayExecutor
PyRuntimeExecutorReplay one stored session without executing its application.
Construction loads the session's ordered input and output events from the
session store. start() creates a fresh event stream and a spawned
process that republishes output until it reaches recorded input.
Live input must match the recorded event exactly. A timeout or mismatch is converted into a failure exit event, allowing the normal runtime and UI paths to report replay failure.
Methods
ReplayExecutor.__init__
__init__(
session_id: str,
session_store_root: Path | None = None,
)Initialize an executor with the events stored for one session.
Parameters
Identifier of the session whose events should be replayed.
Directory containing the session database, or
None to use Yera's default storage directory.
Raises
If the stored events cannot be loaded.
ReplayExecutor.start
start() → NoneStart replay in a spawned process with a fresh event stream.
Calling this method while its replay process is still running has no effect.
ReplayExecutor.stop
stop() → NoneStop replay and release its process and stream resources.
The process is given a bounded opportunity to exit before termination. Streams owned by the executor are closed so blocked output consumers wake up.
ReplayExecutor.make_factory_fn
make_factory_fn(
session_sources: str | dict[str, str],
session_store_root: Path | None = None,
) → Callable[[AppFunctionWrapper, tuple, dict, str], PyRuntimeExecutor]Build an executor factory backed by recorded sessions.
Parameters
One source session ID for every launched session, or live-session IDs mapped to their source session IDs.
Directory containing the session database, or
None to use Yera's default storage directory.
Returns
A runtime-executor factory that resolves each live session to its recorded source.