pub struct RunnerOptions<AppEv, L = ProcLockBackend, R = SystemRuntimeEnvironment> {
pub boot_dir: Option<PathBuf>,
pub restart: RestartPolicyOptions,
pub signal_mapper: SignalMapper<AppEv>,
pub lock_backend: L,
pub runtime_environment: R,
}Expand description
Options used by the async runner.
This is the preferred extension point for app-typed runtime policies such as signal mapping and for runner infrastructure choices such as lock backend, restart behavior, boot-state location, and telemetry provider.
Fields§
§boot_dir: Option<PathBuf>Optional boot-state directory. Defaults to WORA’s host temp boot root.
restart: RestartPolicyOptionsRestart and supervision behavior.
signal_mapper: SignalMapper<AppEv>Translate platform signals into application/runtime events.
The default mapper turns SIGHUP into
ControlEvent::ReloadConfiguration, SIGUSR1 into
ControlEvent::LogRotation, and termination signals into shutdown.
The runner supervises shutdown; reload/log-rotation controls are
delivered to the application.
lock_backend: LLock backend used to serialize workload execution.
runtime_environment: RRuntime environment provider used for host and process telemetry.
Implementations§
Source§impl<AppEv: Send + Sync + 'static> RunnerOptions<AppEv>
impl<AppEv: Send + Sync + 'static> RunnerOptions<AppEv>
Source§impl<AppEv: Send + Sync + 'static, L, R> RunnerOptions<AppEv, L, R>
impl<AppEv: Send + Sync + 'static, L, R> RunnerOptions<AppEv, L, R>
Sourcepub fn with_boot_dir(self, boot_dir: impl Into<PathBuf>) -> Self
pub fn with_boot_dir(self, boot_dir: impl Into<PathBuf>) -> Self
Set the boot-state directory.
Sourcepub fn with_restart_options(self, restart: RestartPolicyOptions) -> Self
pub fn with_restart_options(self, restart: RestartPolicyOptions) -> Self
Set restart and supervision behavior.
Sourcepub fn with_signal_mapper(
self,
mapper: impl Fn(RuntimeSignal) -> Option<Event<AppEv>> + Send + Sync + 'static,
) -> Self
pub fn with_signal_mapper( self, mapper: impl Fn(RuntimeSignal) -> Option<Event<AppEv>> + Send + Sync + 'static, ) -> Self
Set a custom platform signal mapper.
Sourcepub fn with_lock_backend<NewL>(
self,
lock_backend: NewL,
) -> RunnerOptions<AppEv, NewL, R>
pub fn with_lock_backend<NewL>( self, lock_backend: NewL, ) -> RunnerOptions<AppEv, NewL, R>
Set the lock backend used to serialize workload execution.
Sourcepub fn with_runtime_environment<NewR>(
self,
runtime_environment: NewR,
) -> RunnerOptions<AppEv, L, NewR>
pub fn with_runtime_environment<NewR>( self, runtime_environment: NewR, ) -> RunnerOptions<AppEv, L, NewR>
Set the runtime environment provider used for telemetry.