pub struct TaskFollow<'c> { /* private fields */ }Expand description
The updates of one task, from A2aClient::follow_task.
Implementations§
Source§impl TaskFollow<'_>
impl TaskFollow<'_>
Sourcepub const fn is_polling(&self) -> bool
pub const fn is_polling(&self) -> bool
Whether this follows by polling GetTask rather than a subscription.
Sourcepub const fn with_resume(self, policy: ResumePolicy) -> TaskFollow<'_>
pub const fn with_resume(self, policy: ResumePolicy) -> TaskFollow<'_>
Sets how a lost subscription is reopened before polling takes over
(see next). The default is the delegation’s: five
attempts, 200 ms doubling to 5 s, 30 s in all.
Sourcepub async fn next(&mut self) -> Option<Result<StreamResponse, ClientError>>
pub async fn next(&mut self) -> Option<Result<StreamResponse, ClientError>>
The next update: an event from the subscription, or, polling, the
task each time its status changes. None once the subscription ends
or the polled task is in a terminal state.
A subscription that is cut before the task ends is reopened from the
last event id the agent sent, under the ResumePolicy (a stream
that delivered events starts the attempt count again), and the events
it missed are replayed where the agent keeps a log. When the policy is
spent, the agent cannot stream, or it refuses the subscription as it
does for a task already ended, following goes on by polling, whose
first update is the task as it now stands.
Polling waits poll_every between GetTask calls (not before the
first); a failed call is returned and the next next tries again.
Trait Implementations§
Auto Trait Implementations§
impl<'c> !RefUnwindSafe for TaskFollow<'c>
impl<'c> !UnwindSafe for TaskFollow<'c>
impl<'c> Forget for TaskFollow<'c>
impl<'c> Freeze for TaskFollow<'c>
impl<'c> Move for TaskFollow<'c>
impl<'c> Send for TaskFollow<'c>
impl<'c> Sync for TaskFollow<'c>
impl<'c> Unpin for TaskFollow<'c>
impl<'c> UnsafeUnpin for TaskFollow<'c>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].