pub struct InMemoryStreamingHandler { /* private fields */ }Expand description
In-memory AsyncStreamingHandler: per-task broadcast fan-out with a
bounded replay buffer for Last-Event-ID resumption.
Cloning shares the underlying per-task state (an Arc<Mutex<…>>), so a clone
observes the same channels and subscribers.
Implementations§
Trait Implementations§
Source§impl AsyncStreamingHandler for InMemoryStreamingHandler
impl AsyncStreamingHandler for InMemoryStreamingHandler
Source§fn add_status_subscriber<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
subscriber: Box<dyn Subscriber<TaskStatusUpdateEvent> + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<String, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_status_subscriber<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
subscriber: Box<dyn Subscriber<TaskStatusUpdateEvent> + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<String, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add a status update subscriber for a task
Source§fn add_artifact_subscriber<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
subscriber: Box<dyn Subscriber<TaskArtifactUpdateEvent> + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<String, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_artifact_subscriber<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
subscriber: Box<dyn Subscriber<TaskArtifactUpdateEvent> + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<String, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add an artifact update subscriber for a task
Source§fn remove_subscription<'life0, 'life1, 'async_trait>(
&'life0 self,
_subscription_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_subscription<'life0, 'life1, 'async_trait>(
&'life0 self,
_subscription_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove a specific subscription
Source§fn remove_task_subscribers<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_task_subscribers<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove all subscribers for a task
Source§fn get_subscriber_count<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<usize, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_subscriber_count<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<usize, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the number of active subscribers for a task
Source§fn broadcast_status_update<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
update: TaskStatusUpdateEvent,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn broadcast_status_update<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
update: TaskStatusUpdateEvent,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Broadcast a status update to all subscribers of a task
Source§fn broadcast_artifact_update<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
update: TaskArtifactUpdateEvent,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn broadcast_artifact_update<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
update: TaskArtifactUpdateEvent,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Broadcast an artifact update to all subscribers of a task
Source§fn status_update_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
_task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<TaskStatusUpdateEvent, A2AError>> + Send>>, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn status_update_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
_task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<TaskStatusUpdateEvent, A2AError>> + Send>>, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a stream of status updates for a task
Source§fn artifact_update_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
_task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<TaskArtifactUpdateEvent, A2AError>> + Send>>, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn artifact_update_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
_task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<TaskArtifactUpdateEvent, A2AError>> + Send>>, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a stream of artifact updates for a task
Source§fn combined_update_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
from_event_id: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<SeqEvent, A2AError>> + Send>>, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn combined_update_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
from_event_id: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<SeqEvent, A2AError>> + Send>>, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a combined stream of all updates for a task. Read more
Source§fn has_subscribers<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has_subscribers<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if a task has any active subscribers
Source§fn validate_streaming_params<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate_streaming_params<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Validate streaming parameters
Source§fn start_task_streaming<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
from_event_id: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<SeqEvent, A2AError>> + Send>>, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn start_task_streaming<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
from_event_id: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<SeqEvent, A2AError>> + Send>>, A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Start streaming for a task with automatic cleanup. Read more
Source§impl Clone for InMemoryStreamingHandler
impl Clone for InMemoryStreamingHandler
Source§fn clone(&self) -> InMemoryStreamingHandler
fn clone(&self) -> InMemoryStreamingHandler
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for InMemoryStreamingHandler
impl Default for InMemoryStreamingHandler
Source§fn default() -> InMemoryStreamingHandler
fn default() -> InMemoryStreamingHandler
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryStreamingHandler
impl !UnwindSafe for InMemoryStreamingHandler
impl Freeze for InMemoryStreamingHandler
impl Send for InMemoryStreamingHandler
impl Sync for InMemoryStreamingHandler
impl Unpin for InMemoryStreamingHandler
impl UnsafeUnpin for InMemoryStreamingHandler
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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