Skip to main content

PackageStore

Trait PackageStore 

Source
pub trait PackageStore:
    Send
    + Sync
    + 'static {
    // Required methods
    fn put_package<'life0, 'async_trait>(
        &'life0 self,
        record: PackageRecord,
    ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_packages<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<PackageRecord>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete_package<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        workflow_type: &'life1 str,
        content_hash: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn put_package_route<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        workflow_type: &'life1 str,
        content_hash: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn list_package_routes<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<PackageRouteRecord>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Durable persistence contract for runtime-deployed workflow packages.

Every Aion event store must implement this: deployed packages are part of the same durability promise as event history, and a backend that kept history but dropped packages would strand every recovered run on a version the catalog cannot resolve.

Required Methods§

Source

fn put_package<'life0, 'async_trait>( &'life0 self, record: PackageRecord, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Persists record and atomically points the type’s route at it.

This mirrors the engine’s load semantics one-to-one: a successful load always re-points the route of record.workflow_type at record.content_hash, so the persisted package and the persisted route pointer must commit together — a crash between them would resurrect a stale route on restart. Re-persisting an existing (workflow_type, content_hash) replaces the row (idempotent re-deploy) and still re-points the route.

Source

fn list_packages<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<PackageRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lists every persisted package in ascending deployed_at order (ties broken by (workflow_type, content_hash) text order), so startup reload re-applies deploys deterministically.

Source

fn delete_package<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, workflow_type: &'life1 str, content_hash: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Deletes the persisted archive for (workflow_type, content_hash).

Deleting an absent row is a no-op, never an error: unload must be idempotent and versions loaded from operator-supplied files were never persisted.

Source

fn put_package_route<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, workflow_type: &'life1 str, content_hash: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Upserts the route pointer for workflow_type to content_hash.

Used by explicit route re-points (rollback / roll-forward) targeting an already-loaded version; the pointed-at version is not required to have a persisted archive (it may be an operator-file load), and the engine resolves that loudly at reload time.

Source

fn list_package_routes<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<PackageRouteRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lists every persisted route pointer in workflow_type text order.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§