pub struct StreamingFanout<L> { /* private fields */ }Expand description
Fan-out of task updates to live readers and callback subscribers, over an
AsyncEventLog that assigns the ids and keeps the events for replay.
Cloning shares the underlying per-task state (an Arc<Mutex<…>>) and the
log, so a clone observes the same channels and subscribers.
Implementations§
Source§impl<L> StreamingFanout<L>
impl<L> StreamingFanout<L>
Trait Implementations§
Source§impl<L: AsyncEventLog + Clone + 'static> AsyncStreamingHandler for StreamingFanout<L>
impl<L: AsyncEventLog + Clone + 'static> AsyncStreamingHandler for StreamingFanout<L>
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,
Drop the task’s live readers and callback subscribers.
The event log is left alone: a task with nobody listening is exactly the
case a client is about to resume from. Deleting the events is
AsyncEventLog::discard, which an operator’s retention sweep calls.
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 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<L: Clone> Clone for StreamingFanout<L>
impl<L: Clone> Clone for StreamingFanout<L>
Source§fn clone(&self) -> StreamingFanout<L>
fn clone(&self) -> StreamingFanout<L>
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 StreamingFanout<InMemoryEventLog>
impl Default for StreamingFanout<InMemoryEventLog>
Auto Trait Implementations§
impl<L> !RefUnwindSafe for StreamingFanout<L>
impl<L> !UnwindSafe for StreamingFanout<L>
impl<L> Freeze for StreamingFanout<L>where
L: Freeze,
impl<L> Send for StreamingFanout<L>where
L: Send,
impl<L> Sync for StreamingFanout<L>where
L: Sync,
impl<L> Unpin for StreamingFanout<L>where
L: Unpin,
impl<L> UnsafeUnpin for StreamingFanout<L>where
L: UnsafeUnpin,
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