pub struct LocalMesh { /* private fields */ }Implementations§
Source§impl LocalMesh
impl LocalMesh
pub fn new(name: impl Into<String>) -> Self
Sourcepub fn request_queue(&self) -> Arc<RequestQueue>
pub fn request_queue(&self) -> Arc<RequestQueue>
Get the request queue (for sharing with agent wrappers)
Source§impl LocalMesh
impl LocalMesh
Sourcepub async fn broadcast(
&self,
message: Message,
exclude: Option<&str>,
) -> Result<Vec<Result<()>>>
pub async fn broadcast( &self, message: Message, exclude: Option<&str>, ) -> Result<Vec<Result<()>>>
Broadcast a message to all agents in the mesh
Sourcepub async fn submit(&self, target: &str, payload: String) -> Result<String>
pub async fn submit(&self, target: &str, payload: String) -> Result<String>
Submit a request (fire-and-forget). Returns request ID.
Sourcepub fn get_pending(&self) -> Vec<MeshRequest>
pub fn get_pending(&self) -> Vec<MeshRequest>
Get pending requests
Sourcepub fn has_pending(&self) -> bool
pub fn has_pending(&self) -> bool
Check if there are pending requests
Sourcepub fn get_results(&self) -> Vec<MeshResult>
pub fn get_results(&self) -> Vec<MeshResult>
Get available results (removes them from queue)
Sourcepub fn peek_results(&self) -> Vec<MeshResult>
pub fn peek_results(&self) -> Vec<MeshResult>
Peek at results without removing
Sourcepub async fn send_reminders(&self, older_than_secs: f64) -> Result<Vec<String>>
pub async fn send_reminders(&self, older_than_secs: f64) -> Result<Vec<String>>
Send reminders for stale requests
Sourcepub async fn wait_for(
&self,
request_id: &str,
timeout_secs: f64,
reminder_interval_secs: f64,
) -> Result<MeshResult>
pub async fn wait_for( &self, request_id: &str, timeout_secs: f64, reminder_interval_secs: f64, ) -> Result<MeshResult>
Wait for a specific result with auto-reminders
Sourcepub async fn collect_results(
&self,
reminder_interval_secs: f64,
) -> Vec<MeshResult>
pub async fn collect_results( &self, reminder_interval_secs: f64, ) -> Vec<MeshResult>
Collect all results, blocking until all pending complete
Trait Implementations§
Source§impl Mesh for LocalMesh
impl Mesh for LocalMesh
Source§fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the mesh and all registered agents. Read more
Source§fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop the mesh and all agents. Read more
Auto Trait Implementations§
impl Freeze for LocalMesh
impl !RefUnwindSafe for LocalMesh
impl Send for LocalMesh
impl Sync for LocalMesh
impl Unpin for LocalMesh
impl !UnwindSafe for LocalMesh
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