pub struct PluginContext {
pub role: PluginRole,
pub executor: Arc<dyn Executor>,
pub shutdown: Receiver<bool>,
pub rpc_registrar: Option<Arc<dyn RpcRegistrar>>,
pub health_registry: Option<Arc<dyn HealthRegistry>>,
pub metrics_registry: Option<Arc<dyn MetricsRegistry>>,
pub pool: Option<PoolContext>,
}Expand description
What every plugin receives in Plugin::boot.
All fields are cheaply cloneable (Arc or Receiver).
Fields§
§role: PluginRoleWhich process this plugin instance is booting in (phase 79).
In the master the executor is a
NoopExecutor (no PHP); in a worker it
dispatches into that worker’s PHP runtime. A Placement::Both plugin
branches on this; single-placement plugins can ignore it.
executor: Arc<dyn Executor>Send work to a PHP worker.
Valid only when role is PluginRole::Worker; in the
master it is a NoopExecutor whose methods return
Err.
shutdown: Receiver<bool>Fires true when the server is shutting down.
rpc_registrar: Option<Arc<dyn RpcRegistrar>>Register RPC method handlers. None if not available.
health_registry: Option<Arc<dyn HealthRegistry>>Register health checks. None if not available.
metrics_registry: Option<Arc<dyn MetricsRegistry>>Register metrics. None if not available.
pool: Option<PoolContext>The worker pool this instance runs in (phase 85). None in the master
and on the legacy single-process path (treat as “owning pool”). A plugin
that runs_in_every_pool reads
primary to decide full-work vs push-only.
Trait Implementations§
Source§impl Clone for PluginContext
impl Clone for PluginContext
Source§fn clone(&self) -> PluginContext
fn clone(&self) -> PluginContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more