pub struct TaskMonitor { /* private fields */ }Expand description
任务监控器
Implementations§
Source§impl TaskMonitor
impl TaskMonitor
Sourcepub fn new() -> TaskMonitor
pub fn new() -> TaskMonitor
创建新的任务监控器
Sourcepub fn with_event_sender(self, tx: Sender<MonitorEvent>) -> TaskMonitor
pub fn with_event_sender(self, tx: Sender<MonitorEvent>) -> TaskMonitor
设置事件发送器
Sourcepub async fn start_monitoring(&self, task_id: &str, agent_id: &str)
pub async fn start_monitoring(&self, task_id: &str, agent_id: &str)
开始监控任务
Sourcepub async fn update_task_status(
&self,
task_id: &str,
status: TaskExecutionStatus,
progress: u32,
message: Option<String>,
)
pub async fn update_task_status( &self, task_id: &str, status: TaskExecutionStatus, progress: u32, message: Option<String>, )
更新任务状态
Sourcepub async fn complete_task(&self, task_id: &str, result: ExecutionResult)
pub async fn complete_task(&self, task_id: &str, result: ExecutionResult)
任务完成
Sourcepub async fn get_task_snapshot(&self, task_id: &str) -> Option<TaskSnapshot>
pub async fn get_task_snapshot(&self, task_id: &str) -> Option<TaskSnapshot>
获取任务快照
Sourcepub async fn get_all_snapshots(&self) -> Vec<TaskSnapshot>
pub async fn get_all_snapshots(&self) -> Vec<TaskSnapshot>
获取所有任务快照
Sourcepub async fn create_decision(
&self,
todo_id: &str,
decision_type: DecisionType,
description: &str,
options: Vec<DecisionOption>,
recommended_option: Option<usize>,
deadline: Option<u64>,
) -> CriticalDecision
pub async fn create_decision( &self, todo_id: &str, decision_type: DecisionType, description: &str, options: Vec<DecisionOption>, recommended_option: Option<usize>, deadline: Option<u64>, ) -> CriticalDecision
创建决策请求
Sourcepub async fn request_decision(
&self,
decision: CriticalDecision,
) -> Result<HumanResponse, Error>
pub async fn request_decision( &self, decision: CriticalDecision, ) -> Result<HumanResponse, Error>
请求人类决策
Sourcepub async fn submit_human_response(
&self,
decision_id: &str,
selected_option: usize,
comment: Option<String>,
) -> Result<(), Error>
pub async fn submit_human_response( &self, decision_id: &str, selected_option: usize, comment: Option<String>, ) -> Result<(), Error>
提交人类响应
Sourcepub async fn get_pending_decisions(&self) -> Vec<CriticalDecision>
pub async fn get_pending_decisions(&self) -> Vec<CriticalDecision>
获取待处理的决策
Sourcepub async fn handle_agent_message(
&self,
message: SecretaryMessage,
) -> Result<(), Error>
pub async fn handle_agent_message( &self, message: SecretaryMessage, ) -> Result<(), Error>
处理来自执行Agent的消息
Sourcepub async fn get_statistics(&self) -> HashMap<String, usize>
pub async fn get_statistics(&self) -> HashMap<String, usize>
获取统计信息
Trait Implementations§
Source§impl Default for TaskMonitor
impl Default for TaskMonitor
Source§fn default() -> TaskMonitor
fn default() -> TaskMonitor
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TaskMonitor
impl !RefUnwindSafe for TaskMonitor
impl Send for TaskMonitor
impl Sync for TaskMonitor
impl Unpin for TaskMonitor
impl UnsafeUnpin for TaskMonitor
impl !UnwindSafe for TaskMonitor
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 moreSource§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage