Skip to main content

ProcessManager

Struct ProcessManager 

Source
pub struct ProcessManager {
    pub output_tx: Sender<OutputLine>,
    /* private fields */
}

Fields§

§output_tx: Sender<OutputLine>

Implementations§

Source§

impl ProcessManager

Source

pub fn new(session: &str) -> Self

Source

pub async fn spawn_process( &mut self, command: &str, name: Option<String>, cwd: Option<&str>, env: Option<&HashMap<String, String>>, port: Option<u16>, ) -> Response

Source

pub async fn stop_process(&mut self, target: &str) -> Response

Source

pub async fn stop_all(&mut self) -> Response

Source

pub async fn restart_process(&mut self, target: &str) -> Response

Source

pub fn enable_proxy(&mut self)

Source

pub fn status(&mut self) -> Response

Source

pub fn is_process_exited(&mut self, target: &str) -> Option<Option<i32>>

Returns None if process not found or still running. Returns Some(exit_code) if process has exited (exit_code is None for signal kills).

Source

pub fn session_name(&self) -> &str

Source

pub fn has_process(&self, target: &str) -> bool

Source

pub fn running_ports(&self) -> HashMap<String, u16>

Returns a map of running process names to their assigned ports.

Source

pub fn status_snapshot(&self) -> Response

Non-mutating status snapshot for use by the proxy status page. May show stale exit states since it skips refresh_exit_states().

Source

pub fn classify_restart_candidates(&self) -> (Vec<String>, Vec<String>)

Classify exited processes that have a restart policy into “restartable” vs “exhausted”. Returns (restartable, exhausted) name vectors in a single pass.

Source

pub fn mark_failed(&mut self, target: &str)

Mark a process as failed (max restarts exhausted).

Source

pub async fn respawn_in_place(&mut self, target: &str) -> Result<(), String>

Re-spawn a process in place, preserving supervisor metadata. Drains capture tasks, rotates logs, re-spawns, and carries over metadata. On spawn failure, reinserts a tombstone record with failed=true.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,