pub struct BasicRetryWorker<R> {
pub request: R,
pub retries: usize,
}Expand description
A basic worker which can retry on failure
Fields§
§request: RThe worker’s request
retries: usizeThe number of times this worker will retry on failure
Implementations§
Trait Implementations§
Source§impl<R> Clone for BasicRetryWorker<R>where
R: Clone,
impl<R> Clone for BasicRetryWorker<R>where
R: Clone,
Source§impl<R> Debug for BasicRetryWorker<R>where
R: Debug,
impl<R> Debug for BasicRetryWorker<R>where
R: Debug,
Source§impl<R> From<R> for BasicRetryWorker<R>
impl<R> From<R> for BasicRetryWorker<R>
Source§impl<R, H> IntoRespondingWorker<R, H> for BasicRetryWorker<R>
impl<R, H> IntoRespondingWorker<R, H> for BasicRetryWorker<R>
Source§impl<R> RetryableWorker<R> for BasicRetryWorker<R>
impl<R> RetryableWorker<R> for BasicRetryWorker<R>
Source§fn retries_mut(&mut self) -> &mut usize
fn retries_mut(&mut self) -> &mut usize
Mutably access the number of retries remaining
Source§fn with_retries(self, retries: usize) -> Self
fn with_retries(self, retries: usize) -> Self
Update the retry count
Source§fn send_to_reporter(
self: Box<Self>,
reporter: &ReporterHandle,
) -> Result<DecodeResult<R::Marker>, RequestError>
fn send_to_reporter( self: Box<Self>, reporter: &ReporterHandle, ) -> Result<DecodeResult<R::Marker>, RequestError>
Send the worker to a specific reporter, without waiting for a response
Source§fn send_local(self) -> Result<DecodeResult<R::Marker>, RequestError>
fn send_local(self) -> Result<DecodeResult<R::Marker>, RequestError>
Send the worker to the local datacenter, without waiting for a response
Source§fn send_global(self) -> Result<DecodeResult<R::Marker>, RequestError>
fn send_global(self) -> Result<DecodeResult<R::Marker>, RequestError>
Send the worker to a global datacenter, without waiting for a response
Source§fn get_local<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<<R::Marker as Marker>::Output, RequestError>> + Send + 'async_trait>>where
R: SendRequestExt,
Self: 'static + IntoRespondingWorker<R, Sender<Result<Decoder, WorkerError>>, Decoder> + Into<Box<Self>> + Send + 'async_trait,
Self::Output: RetryableWorker<R> + Worker,
R::Marker: Send + Sync,
fn get_local<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<<R::Marker as Marker>::Output, RequestError>> + Send + 'async_trait>>where
R: SendRequestExt,
Self: 'static + IntoRespondingWorker<R, Sender<Result<Decoder, WorkerError>>, Decoder> + Into<Box<Self>> + Send + 'async_trait,
Self::Output: RetryableWorker<R> + Worker,
R::Marker: Send + Sync,
Send the worker to the local datacenter and await a response asynchronously
Source§fn get_local_blocking(
self,
) -> Result<<R::Marker as Marker>::Output, RequestError>where
R: SendRequestExt,
Self: 'static + IntoRespondingWorker<R, Sender<Result<Decoder, WorkerError>>, Decoder> + Into<Box<Self>>,
Self::Output: RetryableWorker<R> + Worker,
fn get_local_blocking(
self,
) -> Result<<R::Marker as Marker>::Output, RequestError>where
R: SendRequestExt,
Self: 'static + IntoRespondingWorker<R, Sender<Result<Decoder, WorkerError>>, Decoder> + Into<Box<Self>>,
Self::Output: RetryableWorker<R> + Worker,
Send the worker to the local datacenter and await a response synchronously
Source§fn get_global<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<<R::Marker as Marker>::Output, RequestError>> + Send + 'async_trait>>where
R: SendRequestExt,
Self: 'static + IntoRespondingWorker<R, Sender<Result<Decoder, WorkerError>>, Decoder> + Into<Box<Self>> + Send + 'async_trait,
Self::Output: RetryableWorker<R> + Worker,
R::Marker: Send + Sync,
fn get_global<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Result<<R::Marker as Marker>::Output, RequestError>> + Send + 'async_trait>>where
R: SendRequestExt,
Self: 'static + IntoRespondingWorker<R, Sender<Result<Decoder, WorkerError>>, Decoder> + Into<Box<Self>> + Send + 'async_trait,
Self::Output: RetryableWorker<R> + Worker,
R::Marker: Send + Sync,
Send the worker to a global datacenter and await a response asynchronously
Source§fn get_global_blocking(
self,
) -> Result<<R::Marker as Marker>::Output, RequestError>where
R: SendRequestExt,
Self: 'static + IntoRespondingWorker<R, Sender<Result<Decoder, WorkerError>>, Decoder> + Into<Box<Self>>,
Self::Output: RetryableWorker<R> + Worker,
fn get_global_blocking(
self,
) -> Result<<R::Marker as Marker>::Output, RequestError>where
R: SendRequestExt,
Self: 'static + IntoRespondingWorker<R, Sender<Result<Decoder, WorkerError>>, Decoder> + Into<Box<Self>>,
Self::Output: RetryableWorker<R> + Worker,
Send the worker to a global datacenter and await a response synchronously
Source§impl<R> Worker for BasicRetryWorker<R>
impl<R> Worker for BasicRetryWorker<R>
Source§fn handle_response(self: Box<Self>, giveload: Vec<u8>) -> Result<()>
fn handle_response(self: Box<Self>, giveload: Vec<u8>) -> Result<()>
Reporter will invoke this method to Send the cql response to worker
Source§fn handle_error(
self: Box<Self>,
error: WorkerError,
reporter_opt: Option<&ReporterHandle>,
) -> Result<()>
fn handle_error( self: Box<Self>, error: WorkerError, reporter_opt: Option<&ReporterHandle>, ) -> Result<()>
Reporter will invoke this method to Send the worker error to worker
Auto Trait Implementations§
impl<R> Freeze for BasicRetryWorker<R>where
R: Freeze,
impl<R> RefUnwindSafe for BasicRetryWorker<R>where
R: RefUnwindSafe,
impl<R> Send for BasicRetryWorker<R>where
R: Send,
impl<R> Sync for BasicRetryWorker<R>where
R: Sync,
impl<R> Unpin for BasicRetryWorker<R>where
R: Unpin,
impl<R> UnwindSafe for BasicRetryWorker<R>where
R: UnwindSafe,
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<E, T, const C: usize> ChannelBuilder<AbortableBoundedChannel<E, C>> for T
impl<E, T, const C: usize> ChannelBuilder<AbortableBoundedChannel<E, C>> for T
Source§fn build_channel<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<AbortableBoundedChannel<E, C>, ActorError>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn build_channel<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<AbortableBoundedChannel<E, C>, ActorError>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
Implement how to build the channel for the corresponding actor
Source§impl<E, T> ChannelBuilder<AbortableUnboundedChannel<E>> for T
impl<E, T> ChannelBuilder<AbortableUnboundedChannel<E>> for T
Source§fn build_channel<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<AbortableUnboundedChannel<E>, ActorError>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn build_channel<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<AbortableUnboundedChannel<E>, ActorError>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
Implement how to build the channel for the corresponding actor
Source§impl<E, T, const C: usize> ChannelBuilder<BoundedChannel<E, C>> for Twhere
E: ShutdownEvent + 'static,
T: Send,
impl<E, T, const C: usize> ChannelBuilder<BoundedChannel<E, C>> for Twhere
E: ShutdownEvent + 'static,
T: Send,
Source§fn build_channel<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<BoundedChannel<E, C>, ActorError>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn build_channel<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<BoundedChannel<E, C>, ActorError>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
Implement how to build the channel for the corresponding actor
Source§impl<T, const I: u64> ChannelBuilder<IntervalChannel<I>> for Twhere
T: Send,
impl<T, const I: u64> ChannelBuilder<IntervalChannel<I>> for Twhere
T: Send,
Source§fn build_channel<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<IntervalChannel<I>, ActorError>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn build_channel<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<IntervalChannel<I>, ActorError>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
Implement how to build the channel for the corresponding actor
Source§impl<T, C, B> ChannelBuilder<Marker<C, B>> for T
impl<T, C, B> ChannelBuilder<Marker<C, B>> for T
Source§fn build_channel<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Marker<C, B>, ActorError>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn build_channel<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Marker<C, B>, ActorError>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
Implement how to build the channel for the corresponding actor
Source§impl<T> ChannelBuilder<NullChannel> for Twhere
T: Send,
impl<T> ChannelBuilder<NullChannel> for Twhere
T: Send,
Source§fn build_channel<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<NullChannel, ActorError>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn build_channel<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<NullChannel, ActorError>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
Implement how to build the channel for the corresponding actor
Source§impl<E, T> ChannelBuilder<UnboundedChannel<E>> for Twhere
E: ShutdownEvent + 'static,
T: Send,
impl<E, T> ChannelBuilder<UnboundedChannel<E>> for Twhere
E: ShutdownEvent + 'static,
T: Send,
Source§fn build_channel<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<UnboundedChannel<E>, ActorError>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn build_channel<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<UnboundedChannel<E>, ActorError>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
Implement how to build the channel for the corresponding actor