pub struct WorkflowCatalog { /* private fields */ }Expand description
Shared, atomically-swappable workflow package catalog.
Implementations§
Source§impl WorkflowCatalog
impl WorkflowCatalog
Sourcepub async fn load_package(
&self,
runtime: &RuntimeHandle,
package: &Package,
) -> Result<LoadOutcome, EngineError>
pub async fn load_package( &self, runtime: &RuntimeHandle, package: &Package, ) -> Result<LoadOutcome, EngineError>
Loads a validated package into the runtime and atomically routes its workflow type’s new dispatches to it.
Re-loading an already-loaded hash registers nothing and returns the
existing record with freshly_loaded = false, but still re-points the
route at it (“deploy archive X” is a routing intent); loading the
currently-routed hash is a full no-op (route_changed = false). An
idempotent re-load whose manifest differs from the resident version’s
manifest is refused typed (EngineError::ManifestMismatch) — the
content hash covers beams only, so a differing manifest means the
archive is not the version the catalog holds.
§Errors
Returns EngineError::Load for validation, collision, registration,
or entry-verification failures, and EngineError::ManifestMismatch
for the same-hash-different-manifest refusal. On failure the snapshot
is untouched: routing, existing versions, and in-flight dispatches are
unaffected.
Source§impl WorkflowCatalog
impl WorkflowCatalog
Sourcepub fn routed(
&self,
workflow_type: &str,
) -> Result<Option<LoadedWorkflow>, EngineError>
pub fn routed( &self, workflow_type: &str, ) -> Result<Option<LoadedWorkflow>, EngineError>
Workflow currently routed for workflow_type, without a start pin.
§Errors
Returns EngineError::CatalogPoisoned when the snapshot lock is poisoned.
Sourcepub fn routed_version(
&self,
workflow_type: &str,
) -> Result<Option<PackageVersion>, EngineError>
pub fn routed_version( &self, workflow_type: &str, ) -> Result<Option<PackageVersion>, EngineError>
Durable textual version currently routed for workflow_type.
§Errors
Returns EngineError::CatalogPoisoned when the snapshot lock is poisoned.
Sourcepub fn get(
&self,
workflow_type: &str,
version: &ContentHash,
) -> Result<Option<LoadedWorkflow>, EngineError>
pub fn get( &self, workflow_type: &str, version: &ContentHash, ) -> Result<Option<LoadedWorkflow>, EngineError>
Exact (type, version) lookup, without a start pin.
§Errors
Returns EngineError::CatalogPoisoned when the snapshot lock is poisoned.
Sourcepub fn workflows(&self) -> Result<Vec<LoadedWorkflow>, EngineError>
pub fn workflows(&self) -> Result<Vec<LoadedWorkflow>, EngineError>
Every retained loaded workflow record.
§Errors
Returns EngineError::CatalogPoisoned when the snapshot lock is poisoned.
Sourcepub fn versions(&self) -> Result<Vec<WorkflowVersionInfo>, EngineError>
pub fn versions(&self) -> Result<Vec<WorkflowVersionInfo>, EngineError>
Every loaded version with its route flag, sorted by (type, loaded_at).
§Errors
Returns EngineError::CatalogPoisoned when the snapshot lock is poisoned.