pub struct MeshRegistry { /* private fields */ }Expand description
Mesh registry state
Implementations§
Source§impl MeshRegistry
impl MeshRegistry
pub fn new() -> Self
pub fn with_persistence(persistence: Persistence) -> Self
Sourcepub async fn register(&self, instance: MeshInstance) -> RegisterResponse
pub async fn register(&self, instance: MeshInstance) -> RegisterResponse
Register a new instance
Sourcepub async fn heartbeat(&self, instance_id: &str) -> HeartbeatResponse
pub async fn heartbeat(&self, instance_id: &str) -> HeartbeatResponse
Update heartbeat timestamp
Sourcepub async fn deregister(&self, instance_id: &str) -> bool
pub async fn deregister(&self, instance_id: &str) -> bool
Remove an instance
Sourcepub async fn list(&self) -> Vec<MeshInstance>
pub async fn list(&self) -> Vec<MeshInstance>
Get all instances
Sourcepub async fn cleanup_stale(&self, timeout_secs: u64)
pub async fn cleanup_stale(&self, timeout_secs: u64)
Check for stale instances and remove them
Sourcepub async fn get_leader(&self) -> Option<String>
pub async fn get_leader(&self) -> Option<String>
Get the current leader ID
Sourcepub async fn send_message(
&self,
source_instance: String,
target_instance: Option<String>,
message_type: MessageType,
payload: Value,
correlation_id: Option<String>,
) -> Result<SendMessageResponse>
pub async fn send_message( &self, source_instance: String, target_instance: Option<String>, message_type: MessageType, payload: Value, correlation_id: Option<String>, ) -> Result<SendMessageResponse>
Send a message to an instance or broadcast
Sourcepub async fn get_pending_messages(&self, instance_id: &str) -> Vec<AgentMessage>
pub async fn get_pending_messages(&self, instance_id: &str) -> Vec<AgentMessage>
Get pending messages for an instance
Sourcepub async fn acknowledge_messages(&self, message_ids: Vec<String>)
pub async fn acknowledge_messages(&self, message_ids: Vec<String>)
Acknowledge/remove messages after delivery
Trait Implementations§
Source§impl Clone for MeshRegistry
impl Clone for MeshRegistry
Source§fn clone(&self) -> MeshRegistry
fn clone(&self) -> MeshRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MeshRegistry
impl !RefUnwindSafe for MeshRegistry
impl Send for MeshRegistry
impl Sync for MeshRegistry
impl Unpin for MeshRegistry
impl !UnwindSafe for MeshRegistry
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