pub struct HistoryPoller<C: HistoryApiClient> { /* private fields */ }Expand description
Polls GetDurableExecutionHistory and feeds results into OperationStorage.
The HistoryPoller periodically calls the history API, handles pagination
within each poll cycle, and retries transient errors with exponential backoff.
Implementations§
Source§impl<C: HistoryApiClient> HistoryPoller<C>
impl<C: HistoryApiClient> HistoryPoller<C>
Sourcepub fn new(api_client: C, arn: String, poll_interval: Duration) -> Self
pub fn new(api_client: C, arn: String, poll_interval: Duration) -> Self
Creates a new HistoryPoller.
§Arguments
api_client- The client used to call the history APIarn- The Durable Execution ARN identifying the execution to pollpoll_interval- Duration to wait between page requests within a poll cycle
Sourcepub async fn poll_once(&mut self) -> Result<PollResult, TestError>
pub async fn poll_once(&mut self) -> Result<PollResult, TestError>
Executes one poll cycle, exhausting all pages via pagination.
Starting from self.last_marker, this method calls the history API
and follows next_marker pagination tokens until no more pages remain.
Between each page request, it waits poll_interval to avoid throttling.
After the cycle completes, self.last_marker is updated to the last
page’s next_marker so the next poll cycle starts where this one left off.
§Returns
A PollResult containing all operations and events aggregated across
all pages, plus any terminal state detected during the cycle.
Auto Trait Implementations§
impl<C> Freeze for HistoryPoller<C>where
C: Freeze,
impl<C> RefUnwindSafe for HistoryPoller<C>where
C: RefUnwindSafe,
impl<C> Send for HistoryPoller<C>
impl<C> Sync for HistoryPoller<C>
impl<C> Unpin for HistoryPoller<C>where
C: Unpin,
impl<C> UnsafeUnpin for HistoryPoller<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for HistoryPoller<C>where
C: 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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more