pub struct HeartbeatService { /* private fields */ }Expand description
Heartbeat service managing periodic keepalive messages
Implementations§
Source§impl HeartbeatService
impl HeartbeatService
Sourcepub fn new(
agent_id: String,
socket: Arc<Mutex<DealerSocket>>,
runtime_handle: Handle,
runtime: Option<Arc<Runtime>>,
interval_secs: f64,
) -> Self
pub fn new( agent_id: String, socket: Arc<Mutex<DealerSocket>>, runtime_handle: Handle, runtime: Option<Arc<Runtime>>, interval_secs: f64, ) -> Self
Create a new heartbeat service
§Arguments
agent_id- Agent identifiersocket- Shared ZMQ socket for sending heartbeatsinterval_secs- Heartbeat interval in seconds
Sourcepub fn with_reconnect_spec(self, spec: ReconnectSpec) -> Self
pub fn with_reconnect_spec(self, spec: ReconnectSpec) -> Self
Enable automatic re-register attempts when heartbeats are rejected due to agent not found.
This is intended for FEAGI restarts (registry reset). It does NOT attempt reconnect
after voluntary deregistration because AgentClient stops this service on disconnect.
Sourcepub fn stop(&mut self)
pub fn stop(&mut self)
Stop the heartbeat service
This ensures proper thread cleanup:
- Signal thread to stop
- Wait for thread to finish (with timeout)
- Force terminate if stuck
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if heartbeat service is running
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HeartbeatService
impl !RefUnwindSafe for HeartbeatService
impl Send for HeartbeatService
impl Sync for HeartbeatService
impl Unpin for HeartbeatService
impl !UnwindSafe for HeartbeatService
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