pub struct Workflow<Start, Current, Backend, T = Identity> { /* private fields */ }Expand description
A workflow represents a sequence of steps to be executed in order.
Implementations§
Source§impl<Start, Cur, B, L> Workflow<Start, Cur, B, L>where
B: BackendExt,
impl<Start, Cur, B, L> Workflow<Start, Cur, B, L>where
B: BackendExt,
Sourcepub fn and_then<F, O, FnArgs>(
self,
and_then: F,
) -> Workflow<Start, O, B, Stack<AndThen<TaskFn<F, Cur, B::Context, FnArgs>>, L>>
pub fn and_then<F, O, FnArgs>( self, and_then: F, ) -> Workflow<Start, O, B, Stack<AndThen<TaskFn<F, Cur, B::Context, FnArgs>>, L>>
Adds a transformation step to the workflow that processes the output of the previous step.
The and_then method allows you to chain operations by providing a function that
takes the result of the current workflow step and transforms it into the input
for the next step. This enables building complex processing pipelines with
type-safe transformations between steps.
§Example
ⓘ
workflow
.and_then(extract)
.and_then(transform)
.and_then(load);Source§impl<Start, Cur, B, L> Workflow<Start, Cur, B, L>
impl<Start, Cur, B, L> Workflow<Start, Cur, B, L>
Sourcepub fn delay_with<F, I>(
self,
f: F,
) -> Workflow<Start, I, B, Stack<DelayWith<F, B, I>, L>>
pub fn delay_with<F, I>( self, f: F, ) -> Workflow<Start, I, B, Stack<DelayWith<F, B, I>, L>>
Delay the workflow by a duration determined by a function
Source§impl<Start, C, L, I: IntoIterator<Item = C>, B: BackendExt> Workflow<Start, I, B, L>
impl<Start, C, L, I: IntoIterator<Item = C>, B: BackendExt> Workflow<Start, I, B, L>
Source§impl<Start, C, L, I: IntoIterator<Item = C>, B: BackendExt> Workflow<Start, I, B, L>
impl<Start, C, L, I: IntoIterator<Item = C>, B: BackendExt> Workflow<Start, I, B, L>
Trait Implementations§
Source§impl<Start: Debug, Current: Debug, Backend: Debug, T: Debug> Debug for Workflow<Start, Current, Backend, T>
impl<Start: Debug, Current: Debug, Backend: Debug, T: Debug> Debug for Workflow<Start, Current, Backend, T>
Source§impl<Input, Output, Current, B, Compact, Err, L> IntoWorkerService<B, WorkflowService<B, Output>, Compact, <B as Backend>::Context> for Workflow<Input, Current, B, L>where
B: BackendExt<Compact = Compact> + Send + Sync + 'static + Sink<Task<Compact, B::Context, B::IdType>, Error = Err> + Unpin + Clone + Backend<Args = Compact, Error = Err>,
Err: Error + Send + Sync + 'static,
B::Context: MetadataExt<WorkflowContext> + Send + Sync + 'static,
B::IdType: Send + 'static + Default + GenerateId,
B::Compact: Send + Sync + 'static,
<B::Context as MetadataExt<WorkflowContext>>::Error: Into<BoxDynError>,
L: Layer<RootStep<Current>>,
L::Step: Step<Output, B>,
impl<Input, Output, Current, B, Compact, Err, L> IntoWorkerService<B, WorkflowService<B, Output>, Compact, <B as Backend>::Context> for Workflow<Input, Current, B, L>where
B: BackendExt<Compact = Compact> + Send + Sync + 'static + Sink<Task<Compact, B::Context, B::IdType>, Error = Err> + Unpin + Clone + Backend<Args = Compact, Error = Err>,
Err: Error + Send + Sync + 'static,
B::Context: MetadataExt<WorkflowContext> + Send + Sync + 'static,
B::IdType: Send + 'static + Default + GenerateId,
B::Compact: Send + Sync + 'static,
<B::Context as MetadataExt<WorkflowContext>>::Error: Into<BoxDynError>,
L: Layer<RootStep<Current>>,
L::Step: Step<Output, B>,
Source§type Backend = RawDataBackend<B>
type Backend = RawDataBackend<B>
The backend type for the worker
Source§fn into_service(
self,
b: B,
) -> WorkerService<RawDataBackend<B>, WorkflowService<B, Output>>
fn into_service( self, b: B, ) -> WorkerService<RawDataBackend<B>, WorkflowService<B, Output>>
Build the service from the backend
Auto Trait Implementations§
impl<Start, Current, Backend, T> Freeze for Workflow<Start, Current, Backend, T>where
T: Freeze,
impl<Start, Current, Backend, T> RefUnwindSafe for Workflow<Start, Current, Backend, T>
impl<Start, Current, Backend, T> Send for Workflow<Start, Current, Backend, T>
impl<Start, Current, Backend, T> Sync for Workflow<Start, Current, Backend, T>
impl<Start, Current, Backend, T> Unpin for Workflow<Start, Current, Backend, T>
impl<Start, Current, Backend, T> UnwindSafe for Workflow<Start, Current, Backend, T>
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> 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, Args, Ctx, Svc, B, M> IntoWorkerServiceExt<Args, Ctx, Svc, B, M> for T
impl<T, Args, Ctx, Svc, B, M> IntoWorkerServiceExt<Args, Ctx, Svc, B, M> for T
Source§fn build_with(
self,
builder: WorkerBuilder<Args, Ctx, B, M>,
) -> Worker<Args, Ctx, <T as IntoWorkerService<B, Svc, Args, Ctx>>::Backend, Svc, M>
fn build_with( self, builder: WorkerBuilder<Args, Ctx, B, M>, ) -> Worker<Args, Ctx, <T as IntoWorkerService<B, Svc, Args, Ctx>>::Backend, Svc, M>
Consumes the builder and returns a worker