pub struct WorkflowsService { /* private fields */ }Implementations§
Source§impl WorkflowsService
impl WorkflowsService
pub fn from_options(opts: &WorkflowsOptions) -> Self
pub async fn start(&self, name: &str, input: Value) -> WorkflowInstance
pub async fn get(&self, id: &str) -> Option<WorkflowInstance>
Sourcepub async fn complete_step(
&self,
id: &str,
step: &str,
result: Value,
) -> Result<WorkflowInstance, String>
pub async fn complete_step( &self, id: &str, step: &str, result: Value, ) -> Result<WorkflowInstance, String>
Advance to the next step, persisting result. Survives process restart via the store.
Sourcepub async fn wait_for_approval(
&self,
id: &str,
) -> Result<WorkflowInstance, String>
pub async fn wait_for_approval( &self, id: &str, ) -> Result<WorkflowInstance, String>
Park the workflow until Self::approve.
pub async fn approve(&self, id: &str) -> Result<WorkflowInstance, String>
Trait Implementations§
Source§impl Injectable for WorkflowsService
impl Injectable for WorkflowsService
fn construct(_registry: &ProviderRegistry) -> Arc<Self> ⓘ
Source§fn scope() -> ProviderScope
fn scope() -> ProviderScope
Provider scope used when the module registers this type.
fn on_module_init<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_module_destroy<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_application_bootstrap<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Source§fn on_before_application_shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_before_application_shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
NestJS
beforeApplicationShutdown: fires before on_application_shutdown /
on_module_destroy during graceful shutdown. Use to flush caches, close
long-lived connections, or release resources while dependents are still alive.fn on_application_shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for WorkflowsService
impl !UnwindSafe for WorkflowsService
impl Forget for WorkflowsService
impl Freeze for WorkflowsService
impl Send for WorkflowsService
impl Sync for WorkflowsService
impl Unpin for WorkflowsService
impl UnsafeUnpin for WorkflowsService
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