pub struct RunnerContext {
pub runner_id: RunnerId,
pub runner_cls: Arc<str>,
pub app_id: Arc<str>,
pub pid: u32,
pub hostname: String,
pub thread_id: u64,
pub parent_ctx: Option<Box<RunnerContext>>,
}Expand description
Context identifying the runner that is executing the current task.
Mirrors pynenc’s RunnerContext with hierarchical parent chain,
process/host metadata, and JSON serialization for monitoring.
Fields§
§runner_id: RunnerIdThe runner’s unique identifier.
runner_cls: Arc<str>The class/type name of the runner (e.g. “PersistentTokioRunner”, “ExternalRunner”).
Set at runner creation time so monitoring and recovery can distinguish
runner types without introspecting the app_id.
app_id: Arc<str>The application identifier (shared via Arc to avoid per-invocation clones).
pid: u32Process ID of the runner.
hostname: StringHostname where the runner is executing.
thread_id: u64Thread ID (or tokio task ID) of the current execution.
parent_ctx: Option<Box<RunnerContext>>Optional parent context (for hierarchical runner relationships).
Implementations§
Source§impl RunnerContext
impl RunnerContext
Sourcepub fn new(
runner_id: RunnerId,
app_id: Arc<str>,
runner_cls: impl Into<Arc<str>>,
) -> Self
pub fn new( runner_id: RunnerId, app_id: Arc<str>, runner_cls: impl Into<Arc<str>>, ) -> Self
Create a new RunnerContext capturing current process/host metadata.
Sourcepub fn new_child(&self, runner_id: RunnerId) -> Self
pub fn new_child(&self, runner_id: RunnerId) -> Self
Create a child context with this context as the parent.
The child inherits the parent’s runner_cls — use this for worker tasks
that run under the same runner type as the parent.
Sourcepub fn root_runner_id(&self) -> &RunnerId
pub fn root_runner_id(&self) -> &RunnerId
Get the root runner_id by traversing up the parent chain.
Trait Implementations§
Source§impl Clone for RunnerContext
impl Clone for RunnerContext
Source§fn clone(&self) -> RunnerContext
fn clone(&self) -> RunnerContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more