pub struct TaskRegistry { /* private fields */ }Implementations§
Source§impl TaskRegistry
impl TaskRegistry
pub fn new(persistence: Arc<dyn Persistence>) -> Self
pub fn with_parent_session(self, parent_id: SessionId) -> Self
pub fn with_ttl(self, ttl: Duration) -> Self
pub async fn register( &self, id: String, agent_type: String, description: String, ) -> Receiver<()>
pub async fn set_handle(&self, id: &str, handle: JoinHandle<()>)
pub async fn complete(&self, id: &str, result: AgentResult)
pub async fn fail(&self, id: &str, error: String)
pub async fn cancel(&self, id: &str) -> bool
pub async fn get_status(&self, id: &str) -> Option<SessionState>
pub async fn get_result( &self, id: &str, ) -> Option<(SessionState, Option<String>, Option<String>)>
pub async fn wait_for_completion( &self, id: &str, timeout: Duration, ) -> Option<(SessionState, Option<String>, Option<String>)>
pub async fn list_running(&self) -> Vec<(String, String, Duration)>
pub async fn cleanup_completed(&self) -> usize
pub async fn running_count(&self) -> usize
pub async fn save_messages(&self, id: &str, messages: Vec<Message>)
pub async fn get_messages(&self, id: &str) -> Option<Vec<Message>>
pub async fn get_session(&self, id: &str) -> Option<Session>
Trait Implementations§
Source§impl Clone for TaskRegistry
impl Clone for TaskRegistry
Source§fn clone(&self) -> TaskRegistry
fn clone(&self) -> TaskRegistry
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 TaskRegistry
impl !RefUnwindSafe for TaskRegistry
impl Send for TaskRegistry
impl Sync for TaskRegistry
impl Unpin for TaskRegistry
impl !UnwindSafe for TaskRegistry
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreCreates a shared type from an unshared type.