pub struct DriverRegistry<Context: Send + Sync> { /* private fields */ }Expand description
Drivers keyed by the specs they own.
Implementations§
Source§impl<Context: Send + Sync> DriverRegistry<Context>
impl<Context: Send + Sync> DriverRegistry<Context>
Sourcepub fn with_node_registry(self, nodes: NodeRegistry) -> Self
pub fn with_node_registry(self, nodes: NodeRegistry) -> Self
Enable lazy execution of published specs using this immutable registry snapshot.
Sourcepub fn prewarm_spec(&mut self, spec: &Spec) -> Result<(), String>
pub fn prewarm_spec(&mut self, spec: &Spec) -> Result<(), String>
Precompile a shipped graph. Execution still requires its published revision.
Sourcepub async fn resolve_revision(
&self,
item: &WorkItem,
revision: WorkflowRevision,
) -> Result<Arc<dyn WorkflowDriver<Context>>, String>where
Context: 'static,
pub async fn resolve_revision(
&self,
item: &WorkItem,
revision: WorkflowRevision,
) -> Result<Arc<dyn WorkflowDriver<Context>>, String>where
Context: 'static,
Validate and compile the exact published graph, caching at most 256 revisions. Callers must load the revision through the owner-scoped durable queue first.
Sourcepub fn register(
&mut self,
driver: Arc<dyn WorkflowDriver<Context>>,
) -> Result<&mut Self, SupervisorError>
pub fn register( &mut self, driver: Arc<dyn WorkflowDriver<Context>>, ) -> Result<&mut Self, SupervisorError>
Register a driver. Duplicate spec ownership is a startup error because dispatch must never depend on registration order.
Sourcepub fn for_spec(
&self,
spec_id: &str,
) -> Option<&Arc<dyn WorkflowDriver<Context>>>
pub fn for_spec( &self, spec_id: &str, ) -> Option<&Arc<dyn WorkflowDriver<Context>>>
Driver owning spec_id.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether no driver is registered or prewarmed; published graphs may still resolve lazily.
Sourcepub fn validate_all(&self) -> Result<(), SupervisorError>
pub fn validate_all(&self) -> Result<(), SupervisorError>
Validate every driver’s spec set.
Trait Implementations§
Auto Trait Implementations§
impl<Context> !Freeze for DriverRegistry<Context>
impl<Context> !RefUnwindSafe for DriverRegistry<Context>
impl<Context> !UnwindSafe for DriverRegistry<Context>
impl<Context> Send for DriverRegistry<Context>
impl<Context> Sync for DriverRegistry<Context>
impl<Context> Unpin for DriverRegistry<Context>
impl<Context> UnsafeUnpin for DriverRegistry<Context>where
Vec<Arc<dyn WorkflowDriver<Context>>>: UnsafeUnpin,
HashMap<String, Arc<dyn WorkflowDriver<Context>>>: UnsafeUnpin,
Mutex<VecDeque<CompiledRevision<Context>>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more