pub struct ProcessManager { /* private fields */ }Expand description
Manager for background processes
Implementations§
Source§impl ProcessManager
impl ProcessManager
pub fn new() -> Self
pub async fn has_reserved_port(&self, port: u16) -> bool
pub async fn reserve_port(&self, port: u16) -> Result<u16>
pub async fn reserve_available_port(&self, start: u16, end: u16) -> Result<u16>
pub async fn release_reserved_port(&self, port: u16) -> bool
pub async fn clear_port_reservations(&self) -> usize
pub async fn inventory(&self, log_lines: usize) -> ProcessInventory
pub fn try_inventory(&self, log_lines: usize) -> Option<ProcessInventory>
pub async fn reconcile(&self, prune_inactive: bool) -> ProcessReconcileReport
Sourcepub async fn start(&self, config: ProcessConfig) -> Result<ProcessSummary>
pub async fn start(&self, config: ProcessConfig) -> Result<ProcessSummary>
Start a new managed process
Sourcepub async fn stop(&self, id: &str, force: bool) -> Result<ProcessSummary>
pub async fn stop(&self, id: &str, force: bool) -> Result<ProcessSummary>
Stop a managed process
Sourcepub async fn stop_all(&self) -> usize
pub async fn stop_all(&self) -> usize
Stop all running managed processes gracefully.
Returns the number of processes that were actually stopped.
Sourcepub async fn list(&self) -> Vec<ProcessSummary>
pub async fn list(&self) -> Vec<ProcessSummary>
List all managed processes
Sourcepub async fn logs(&self, id: &str, lines: usize) -> Result<Vec<LogLine>>
pub async fn logs(&self, id: &str, lines: usize) -> Result<Vec<LogLine>>
Get logs for a specific process
Sourcepub async fn get(&self, id: &str) -> Result<ProcessSummary>
pub async fn get(&self, id: &str) -> Result<ProcessSummary>
Get a process summary
Sourcepub async fn restart(&self, id: &str) -> Result<ProcessSummary>
pub async fn restart(&self, id: &str) -> Result<ProcessSummary>
Restart a process
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProcessManager
impl !RefUnwindSafe for ProcessManager
impl Send for ProcessManager
impl Sync for ProcessManager
impl Unpin for ProcessManager
impl UnsafeUnpin for ProcessManager
impl !UnwindSafe for ProcessManager
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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request