Skip to main content

CloacinaPlugin

Trait CloacinaPlugin 

Source
pub trait CloacinaPlugin: Send + Sync {
    // Required methods
    fn get_task_metadata(&self) -> Result<PackageTasksMetadata, PluginError>;
    fn execute_task(
        &self,
        request: TaskExecutionRequest,
    ) -> Result<TaskExecutionResult, PluginError>;
    fn get_graph_metadata(&self) -> Result<GraphPackageMetadata, PluginError>;
    fn execute_graph(
        &self,
        request: GraphExecutionRequest,
    ) -> Result<GraphExecutionResult, PluginError>;
    fn get_reactor_metadata(
        &self,
    ) -> Result<Vec<ReactorPackageMetadata>, PluginError>;
    fn get_trigger_metadata(
        &self,
    ) -> Result<Vec<TriggerPackageMetadata>, PluginError>;
    fn invoke_trigger_poll(
        &self,
        request: TriggerInvokeRequest,
    ) -> Result<TriggerInvokeResult, PluginError>;
    fn get_triggerless_graph_metadata(
        &self,
    ) -> Result<Vec<TriggerlessGraphMetadataEntry>, PluginError>;
    fn invoke_triggerless_graph(
        &self,
        request: TriggerlessGraphInvokeRequest,
    ) -> Result<TriggerlessGraphInvokeResult, PluginError>;
}
Expand description

The plugin interface for cloacina workflow packages.

Every packaged workflow implements this trait (via #[plugin_impl] generated by the #[workflow] macro). The host calls these methods through a fidius PluginHandle — never directly.

§Methods

  • get_task_metadata — Returns metadata about all tasks in the workflow (IDs, dependencies, descriptions). Called once at registration time.
  • execute_task — Runs a specific task by name with a JSON-serialized context. Returns the updated context or an error.

Required Methods§

Source

fn get_task_metadata(&self) -> Result<PackageTasksMetadata, PluginError>

Returns metadata about all tasks in this workflow package. Method index 0.

Source

fn execute_task( &self, request: TaskExecutionRequest, ) -> Result<TaskExecutionResult, PluginError>

Executes a task by name with the given context. Method index 1.

Source

fn get_graph_metadata(&self) -> Result<GraphPackageMetadata, PluginError>

Returns metadata about the computation graph in this package. Method index 2. Only called when the package declares a CG. Packages without a graph return an error or NotImplemented.

Source

fn execute_graph( &self, request: GraphExecutionRequest, ) -> Result<GraphExecutionResult, PluginError>

Executes the computation graph with the given cache state. Method index 3. Only called when the package declares a CG. Packages without a graph return an error.

Source

fn get_reactor_metadata( &self, ) -> Result<Vec<ReactorPackageMetadata>, PluginError>

Returns metadata about all reactors declared by this package. Method index 4. Optional (since version 2): plugins built against version-1 hosts return CallError::NotImplemented, which the reconciler treats as “package declares no reactors”. Packages built from the unified cloacina::package!() shell walk their local inventory::iter::<ReactorEntry> and project each entry into a ReactorPackageMetadata value. (T-A — I-0102)

Source

fn get_trigger_metadata( &self, ) -> Result<Vec<TriggerPackageMetadata>, PluginError>

Returns metadata about all triggers declared by this package. Method index 5. Optional (since version 2): same NotImplemented fallback as get_reactor_metadata. The unified cloacina::package!() shell walks inventory::iter::<TriggerEntry>, calls each entry’s constructor, and queries poll_interval() / cron_expression() / allow_concurrent() on the resulting Arc<dyn Trigger>. The reconciler routes cron-shaped entries (cron_expression present) to the cron scheduler and the rest to the runtime trigger registry. (T-A — I-0102)

Source

fn invoke_trigger_poll( &self, request: TriggerInvokeRequest, ) -> Result<TriggerInvokeResult, PluginError>

Polls a named trigger across the FFI boundary and returns a wire- format TriggerInvokeResult describing whether to fire the associated workflow. Method index 6. Optional (since version 2): the host’s FfiTriggerImpl adapter calls this on every scheduled poll for triggers that came from a packaged cdylib (where inventory doesn’t span linker boundaries, so the host can’t build a host-side Arc<dyn Trigger> directly). Plugins built from the unified cloacina::package!() shell walk inventory::iter::<TriggerEntry> for the matching name, call the constructor, and dispatch Trigger::poll() through the shared cdylib tokio runtime.

Source

fn get_triggerless_graph_metadata( &self, ) -> Result<Vec<TriggerlessGraphMetadataEntry>, PluginError>

Returns metadata about every trigger-less computation graph declared by this package. Method index 7. Optional (since version 2): plugins built before T-0553’s follow-up gap-close return CallError::NotImplemented, which the reconciler treats as “package declares no trigger-less graphs”. The unified cloacina::package!() shell walks inventory::iter::<TriggerlessGraphEntry> and projects each entry’s name + terminal_node_names into a TriggerlessGraphMetadataEntry. Used by step_load_triggerless_cgs to register host-side TriggerlessGraphRegistration adapters that dispatch invocation through invoke_triggerless_graph (method index 8).

Source

fn invoke_triggerless_graph( &self, request: TriggerlessGraphInvokeRequest, ) -> Result<TriggerlessGraphInvokeResult, PluginError>

Invokes a named trigger-less computation graph across the FFI boundary and returns a wire-format result. Method index 8. Optional (since version 2): the host’s FfiTriggerlessGraph adapter calls this on every workflow-task invocation for graphs that came from a packaged cdylib. The shell walks inventory::iter::<TriggerlessGraphEntry> for the matching name, calls the constructor, and dispatches graph_fn(ctx) on the cdylib’s shared tokio runtime.

Implementors§