pub struct Workflow<I, O> { /* private fields */ }Expand description
A workflow is a collection of tasks that can be executed by a worker, often forming a directed acyclic graph (DAG). See Hatchet.workflow() for more information.
Implementations§
Source§impl<I, O> Workflow<I, O>
impl<I, O> Workflow<I, O>
pub fn add_task<P>(self, task: &Task<I, P>) -> Self
Sourcepub async fn schedule(
&self,
trigger_at: DateTime<Utc>,
input: &I,
options: Option<&ScheduleOptions>,
) -> Result<ScheduledRun, HatchetError>
pub async fn schedule( &self, trigger_at: DateTime<Utc>, input: &I, options: Option<&ScheduleOptions>, ) -> Result<ScheduledRun, HatchetError>
Schedule this workflow to run at a specific future time.
See SchedulesClient::create for the underlying API.
Sourcepub async fn cron(
&self,
name: &str,
expression: &str,
input: &I,
options: Option<&CronOptions>,
) -> Result<CronTrigger, HatchetError>
pub async fn cron( &self, name: &str, expression: &str, input: &I, options: Option<&CronOptions>, ) -> Result<CronTrigger, HatchetError>
Create a recurring cron trigger for this workflow.
See CronsClient::create for the underlying API.
Trait Implementations§
Source§impl<I, O> Register<Workflow<I, O>, I, O> for Worker
impl<I, O> Register<Workflow<I, O>, I, O> for Worker
fn add_task_or_workflow(self, workflow: &Workflow<I, O>) -> Self
Source§impl<I, O> Runnable<I, O> for Workflow<I, O>where
I: Serialize + Send + Sync + DeserializeOwned + 'static,
O: DeserializeOwned + Send + Sync + 'static,
impl<I, O> Runnable<I, O> for Workflow<I, O>where
I: Serialize + Send + Sync + DeserializeOwned + 'static,
O: DeserializeOwned + Send + Sync + 'static,
fn get_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<GetWorkflowRunResponse, HatchetError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run_no_wait<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 I,
options: Option<&'life2 TriggerWorkflowOptions>,
) -> Pin<Box<dyn Future<Output = Result<String, HatchetError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn run<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 I,
options: Option<&'life2 TriggerWorkflowOptions>,
) -> Pin<Box<dyn Future<Output = Result<O, HatchetError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl<I, O> !Freeze for Workflow<I, O>
impl<I, O> !RefUnwindSafe for Workflow<I, O>
impl<I, O> Send for Workflow<I, O>
impl<I, O> Sync for Workflow<I, O>
impl<I, O> Unpin for Workflow<I, O>
impl<I, O> UnsafeUnpin for Workflow<I, O>
impl<I, O> !UnwindSafe for Workflow<I, O>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request