pub trait ProcedureManager:
Send
+ Sync
+ 'static {
// Required methods
fn register_loader(
&self,
name: &str,
loader: BoxedProcedureLoader,
) -> Result<()>;
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn submit<'life0, 'async_trait>(
&'life0 self,
procedure: ProcedureWithId,
) -> Pin<Box<dyn Future<Output = Result<Watcher>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn procedure_state<'life0, 'async_trait>(
&'life0 self,
procedure_id: ProcedureId,
) -> Pin<Box<dyn Future<Output = Result<Option<ProcedureState>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn procedure_watcher(&self, procedure_id: ProcedureId) -> Option<Watcher>;
fn list_procedures<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProcedureInfo>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
ProcedureManager
executes Procedure submitted to it.
Required Methods§
Sourcefn register_loader(
&self,
name: &str,
loader: BoxedProcedureLoader,
) -> Result<()>
fn register_loader( &self, name: &str, loader: BoxedProcedureLoader, ) -> Result<()>
Registers loader for specific procedure type name
.
Sourcefn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Starts the background GC task.
Recovers unfinished procedures and reruns them.
Callers should ensure all loaders are registered.
Sourcefn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stops the background GC task.
Sourcefn submit<'life0, 'async_trait>(
&'life0 self,
procedure: ProcedureWithId,
) -> Pin<Box<dyn Future<Output = Result<Watcher>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit<'life0, 'async_trait>(
&'life0 self,
procedure: ProcedureWithId,
) -> Pin<Box<dyn Future<Output = Result<Watcher>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Submits a procedure to execute.
Returns a Watcher to watch the created procedure.
Sourcefn procedure_state<'life0, 'async_trait>(
&'life0 self,
procedure_id: ProcedureId,
) -> Pin<Box<dyn Future<Output = Result<Option<ProcedureState>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn procedure_state<'life0, 'async_trait>(
&'life0 self,
procedure_id: ProcedureId,
) -> Pin<Box<dyn Future<Output = Result<Option<ProcedureState>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Query the procedure state.
Returns Ok(None)
if the procedure doesn’t exist.
Sourcefn procedure_watcher(&self, procedure_id: ProcedureId) -> Option<Watcher>
fn procedure_watcher(&self, procedure_id: ProcedureId) -> Option<Watcher>
Returns a Watcher to watch ProcedureState of specific procedure.
Sourcefn list_procedures<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProcedureInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_procedures<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProcedureInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the details of the procedure.