pub struct RuntimeDaemon { /* private fields */ }Expand description
Runtime daemon for auto-creating mocks from 404s
Implementations§
Source§impl RuntimeDaemon
impl RuntimeDaemon
Sourcepub fn new(config: RuntimeDaemonConfig) -> Self
pub fn new(config: RuntimeDaemonConfig) -> Self
Create a new runtime daemon with the given configuration
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if the daemon is enabled
Sourcepub fn config(&self) -> &RuntimeDaemonConfig
pub fn config(&self) -> &RuntimeDaemonConfig
Get the configuration
Sourcepub fn spawn_federation_scenario_poller(
&self,
) -> Result<Option<JoinHandle<()>>, String>
pub fn spawn_federation_scenario_poller( &self, ) -> Result<Option<JoinHandle<()>>, String>
Opt-in: spawn a [mockforge_scenarios::FederationScenarioPoller]
using the standard MOCKFORGE_FEDERATION_POLL_* env vars.
Returns Ok(None) when the env vars aren’t configured (the 99%
zero-config case — the daemon stays pure 404-generation). Returns
Ok(Some(handle)) when a poller spawns; drop the handle to stop it.
The default [mockforge_scenarios::LoggingApplicator] only logs
observed overrides. A real embedder wanting to push them to the
daemon’s auto-generator (e.g. bumping chaos level based on a
scenario) should call [mockforge_scenarios::spawn_federation_scenario_poller]
directly with a custom ScenarioApplicator impl.
§Errors
Returns an error string when env vars are malformed (bad UUID, non-numeric interval). Missing vars are not an error.