pub struct RemoteMonitor { /* private fields */ }Expand description
Remote monitoring server
Implementations§
Source§impl RemoteMonitor
impl RemoteMonitor
Sourcepub fn new(config: RemoteMonitorConfig) -> Self
pub fn new(config: RemoteMonitorConfig) -> Self
Create a new remote monitor
Sourcepub fn subscribe(&self) -> Receiver<RemoteEvent>
pub fn subscribe(&self) -> Receiver<RemoteEvent>
Subscribe to events
Sourcepub async fn register_node(
&self,
node: RemoteNode,
) -> Result<(), RemoteMonitorError>
pub async fn register_node( &self, node: RemoteNode, ) -> Result<(), RemoteMonitorError>
Register a new node
Sourcepub async fn unregister_node(
&self,
node_id: &str,
) -> Result<bool, RemoteMonitorError>
pub async fn unregister_node( &self, node_id: &str, ) -> Result<bool, RemoteMonitorError>
Unregister a node
Sourcepub async fn heartbeat(&self, node_id: &str) -> Result<(), RemoteMonitorError>
pub async fn heartbeat(&self, node_id: &str) -> Result<(), RemoteMonitorError>
Update node heartbeat
Sourcepub async fn get_node(&self, node_id: &str) -> Option<RemoteNode>
pub async fn get_node(&self, node_id: &str) -> Option<RemoteNode>
Get node by ID
Sourcepub async fn list_nodes(&self) -> Vec<RemoteNode>
pub async fn list_nodes(&self) -> Vec<RemoteNode>
List all nodes
Sourcepub async fn list_nodes_by_status(&self, status: NodeStatus) -> Vec<RemoteNode>
pub async fn list_nodes_by_status(&self, status: NodeStatus) -> Vec<RemoteNode>
List nodes by status
Sourcepub async fn create_task(
&self,
task: RemoteTask,
) -> Result<RemoteTaskId, RemoteMonitorError>
pub async fn create_task( &self, task: RemoteTask, ) -> Result<RemoteTaskId, RemoteMonitorError>
Create a new task
Sourcepub async fn update_task_status(
&self,
task_id: &str,
status: RemoteTaskStatus,
) -> Result<(), RemoteMonitorError>
pub async fn update_task_status( &self, task_id: &str, status: RemoteTaskStatus, ) -> Result<(), RemoteMonitorError>
Update task status
Sourcepub async fn update_task_progress(
&self,
task_id: &str,
progress: f32,
message: Option<String>,
) -> Result<(), RemoteMonitorError>
pub async fn update_task_progress( &self, task_id: &str, progress: f32, message: Option<String>, ) -> Result<(), RemoteMonitorError>
Update task progress
Sourcepub async fn update_task_step(
&self,
task_id: &str,
step: u32,
total: u32,
description: Option<String>,
) -> Result<(), RemoteMonitorError>
pub async fn update_task_step( &self, task_id: &str, step: u32, total: u32, description: Option<String>, ) -> Result<(), RemoteMonitorError>
Update task step
Sourcepub async fn complete_task(
&self,
task_id: &str,
result: TaskResult,
) -> Result<(), RemoteMonitorError>
pub async fn complete_task( &self, task_id: &str, result: TaskResult, ) -> Result<(), RemoteMonitorError>
Complete a task
Sourcepub async fn fail_task(
&self,
task_id: &str,
error: String,
) -> Result<(), RemoteMonitorError>
pub async fn fail_task( &self, task_id: &str, error: String, ) -> Result<(), RemoteMonitorError>
Fail a task
Sourcepub async fn cancel_task(
&self,
task_id: &str,
reason: Option<String>,
) -> Result<(), RemoteMonitorError>
pub async fn cancel_task( &self, task_id: &str, reason: Option<String>, ) -> Result<(), RemoteMonitorError>
Cancel a task
Sourcepub async fn add_task_log(
&self,
task_id: &str,
entry: TaskLogEntry,
) -> Result<(), RemoteMonitorError>
pub async fn add_task_log( &self, task_id: &str, entry: TaskLogEntry, ) -> Result<(), RemoteMonitorError>
Add log entry to task
Sourcepub async fn get_task(&self, task_id: &str) -> Option<RemoteTask>
pub async fn get_task(&self, task_id: &str) -> Option<RemoteTask>
Get task by ID
Sourcepub async fn list_tasks(&self) -> Vec<RemoteTask>
pub async fn list_tasks(&self) -> Vec<RemoteTask>
List all tasks
Sourcepub async fn list_tasks_by_node(&self, node_id: &str) -> Vec<RemoteTask>
pub async fn list_tasks_by_node(&self, node_id: &str) -> Vec<RemoteTask>
List tasks by node
Sourcepub async fn list_tasks_by_status(
&self,
status: RemoteTaskStatus,
) -> Vec<RemoteTask>
pub async fn list_tasks_by_status( &self, status: RemoteTaskStatus, ) -> Vec<RemoteTask>
List tasks by status
Sourcepub async fn list_tasks_by_agent(&self, agent_id: &str) -> Vec<RemoteTask>
pub async fn list_tasks_by_agent(&self, agent_id: &str) -> Vec<RemoteTask>
List tasks by agent
Sourcepub async fn get_stats(&self) -> MonitorStats
pub async fn get_stats(&self) -> MonitorStats
Get monitoring statistics
Sourcepub async fn check_node_timeouts(&self)
pub async fn check_node_timeouts(&self)
Check for timed out nodes and update their status
Sourcepub fn config(&self) -> &RemoteMonitorConfig
pub fn config(&self) -> &RemoteMonitorConfig
Get configuration
Auto Trait Implementations§
impl Freeze for RemoteMonitor
impl !RefUnwindSafe for RemoteMonitor
impl Send for RemoteMonitor
impl Sync for RemoteMonitor
impl Unpin for RemoteMonitor
impl !UnwindSafe for RemoteMonitor
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