Skip to main content

ProcessRegistry

Struct ProcessRegistry 

Source
pub struct ProcessRegistry { /* private fields */ }

Implementations§

Source§

impl ProcessRegistry

Source

pub fn new(config: ProcessRegistryConfig) -> Self

Source

pub fn subscribe(&self) -> Receiver<RoderEvent>

Source

pub async fn register( &self, process: ProcessDescriptor, stopper: Option<Arc<dyn ProcessStopper>>, ) -> Result<ProcessDescriptor>

Source

pub async fn list(&self, include_completed: bool) -> Vec<ProcessDescriptor>

Source

pub async fn get(&self, process_id: &str) -> Option<ProcessDescriptor>

Source

pub async fn output(&self, process_id: &str) -> Vec<ProcessOutput>

Source

pub async fn output_for_task(&self, task_id: &str) -> Vec<ProcessOutput>

Source

pub async fn append_output(&self, output: ProcessOutput) -> Result<()>

Source

pub async fn mark_exited( &self, process_id: &str, exit_code: Option<i32>, ) -> Result<()>

Source

pub async fn mark_failed(&self, process_id: &str, error: String) -> Result<()>

Source

pub async fn mark_stopped( &self, process_id: &str, reason: Option<String>, ) -> Result<()>

Source

pub async fn stop( &self, process_id: &str, reason: Option<String>, ) -> Result<ProcessStopResult>

Source

pub async fn stop_all(&self, reason: Option<String>) -> Vec<ProcessStopResult>

Source

pub async fn append_task_output( &self, task_id: &str, stream: TaskOutputStream, chunk: String, dropped_bytes: u64, thread_id: Option<String>, turn_id: Option<String>, ) -> Result<()>

Trait Implementations§

Source§

impl Clone for ProcessRegistry

Source§

fn clone(&self) -> ProcessRegistry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for ProcessRegistry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl ProcessRegistrySink for ProcessRegistry

Source§

fn register_process<'life0, 'async_trait>( &'life0 self, process: ProcessDescriptor, stopper: Option<Arc<dyn ProcessStopper>>, ) -> Pin<Box<dyn Future<Output = Result<ProcessDescriptor>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn append_process_output<'life0, 'async_trait>( &'life0 self, output: ProcessOutput, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn mark_process_exited<'life0, 'life1, 'async_trait>( &'life0 self, process_id: &'life1 str, exit_code: Option<i32>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn mark_process_failed<'life0, 'life1, 'async_trait>( &'life0 self, process_id: &'life1 str, error: String, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn mark_process_stopped<'life0, 'life1, 'async_trait>( &'life0 self, process_id: &'life1 str, reason: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.