pub struct RunnableRetry<I: Send + Sync + 'static, O: Send + Sync + 'static> { /* private fields */ }Expand description
A Runnable wrapper that retries the inner Runnable on failure.
Implementations§
Source§impl<I: Send + Sync + 'static, O: Send + Sync + 'static> RunnableRetry<I, O>
impl<I: Send + Sync + 'static, O: Send + Sync + 'static> RunnableRetry<I, O>
Sourcepub fn new(runnable: Box<dyn RunnableAny>, retry_config: RetryConfig) -> Self
pub fn new(runnable: Box<dyn RunnableAny>, retry_config: RetryConfig) -> Self
Creates a new RunnableRetry from a boxed RunnableAny.
Trait Implementations§
Source§impl<I, O: Send + Sync + 'static> Runnable<I, O> for RunnableRetry<I, O>
impl<I, O: Send + Sync + 'static> Runnable<I, O> for RunnableRetry<I, O>
Source§fn invoke<'life0, 'async_trait>(
&'life0 self,
input: I,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<O, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn invoke<'life0, 'async_trait>(
&'life0 self,
input: I,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<O, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Transforms single input to output. Read more
Source§fn stream<'life0, 'async_trait>(
&'life0 self,
input: I,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<O, Self::Error>> + Send>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream<'life0, 'async_trait>(
&'life0 self,
input: I,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<O, Self::Error>> + Send>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Streaming output - for real-time responses (LLM, etc). Read more
Source§fn batch<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<Input>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Output>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn batch<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<Input>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Output>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Batch processing - transforms multiple inputs to outputs. Read more
Source§fn transform<'life0, 'async_trait>(
&'life0 self,
input: Pin<Box<dyn Stream<Item = Result<Input, Self::Error>> + Send>>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Output, Self::Error>> + Send>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transform<'life0, 'async_trait>(
&'life0 self,
input: Pin<Box<dyn Stream<Item = Result<Input, Self::Error>> + Send>>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Output, Self::Error>> + Send>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stream-to-stream transformation - the core of LCEL streaming. Read more
Auto Trait Implementations§
impl<I, O> !RefUnwindSafe for RunnableRetry<I, O>
impl<I, O> !UnwindSafe for RunnableRetry<I, O>
impl<I, O> Freeze for RunnableRetry<I, O>
impl<I, O> Send for RunnableRetry<I, O>
impl<I, O> Sync for RunnableRetry<I, O>
impl<I, O> Unpin for RunnableRetry<I, O>
impl<I, O> UnsafeUnpin for RunnableRetry<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> 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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<I, O, R> RunnableExt<I, O> for R
impl<I, O, R> RunnableExt<I, O> for R
Source§fn pipe<O2, R2>(self, other: R2) -> RunnableSequence<Input, O2>
fn pipe<O2, R2>(self, other: R2) -> RunnableSequence<Input, O2>
Pipe the output of this runnable into another runnable. Read more
Source§fn into_sequence(self) -> RunnableSequence<Input, Output>
fn into_sequence(self) -> RunnableSequence<Input, Output>
Create a
RunnableSequence from this runnable as a single step. Read moreSource§fn with_fallbacks<R>(
self,
fallbacks: Vec<R>,
) -> RunnableWithFallbacks<Input, Output>
fn with_fallbacks<R>( self, fallbacks: Vec<R>, ) -> RunnableWithFallbacks<Input, Output>
Add fallback runnables that are tried if this one fails. Read more
Source§fn with_retry(self, retry_config: RetryConfig) -> RunnableRetry<Input, Output>where
Input: Clone,
fn with_retry(self, retry_config: RetryConfig) -> RunnableRetry<Input, Output>where
Input: Clone,
Wrap this runnable with retry logic using exponential backoff. Read more