pub struct A2ATaskExecutor { /* private fields */ }Expand description
The A2A task executor: polls for pending tasks and executes them via fighters.
Implementations§
Source§impl A2ATaskExecutor
impl A2ATaskExecutor
Sourcepub fn new(ring: Arc<Ring>, tasks: Arc<DashMap<String, A2ATask>>) -> Self
pub fn new(ring: Arc<Ring>, tasks: Arc<DashMap<String, A2ATask>>) -> Self
Create a new executor that will poll the given task map and use the Ring to spawn fighters for execution.
Sourcepub fn with_poll_interval(
ring: Arc<Ring>,
tasks: Arc<DashMap<String, A2ATask>>,
poll_interval: Duration,
) -> Self
pub fn with_poll_interval( ring: Arc<Ring>, tasks: Arc<DashMap<String, A2ATask>>, poll_interval: Duration, ) -> Self
Create a new executor with a custom polling interval.
Sourcepub fn start(&mut self)
pub fn start(&mut self)
Start the background polling loop.
Spawns a tokio task that polls the DashMap every poll_interval for
Pending tasks. Each pending task is picked
up and executed in its own spawned task.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Returns true if the executor is currently running.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for A2ATaskExecutor
impl !RefUnwindSafe for A2ATaskExecutor
impl Send for A2ATaskExecutor
impl Sync for A2ATaskExecutor
impl Unpin for A2ATaskExecutor
impl UnsafeUnpin for A2ATaskExecutor
impl !UnwindSafe for A2ATaskExecutor
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> 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>
Converts
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>
Converts
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