pub trait NamespacedOrchestrator: Debug + Send + Sync {
    fn ensure_service<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        config: ServiceConfig<'life2>
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Service>, Error>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait
; fn drop_service<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn list_services<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; fn watch_services(&self) -> BoxStream<'static, Result<ServiceEvent, Error>>; fn fetch_service_metrics<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ServiceProcessMetrics>, Error>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; }
Expand description

An orchestrator restricted to a single namespace.

Required Methods§

Ensures that a service with the given configuration is running.

If a service with the same ID already exists, its configuration is updated to match config. This may or may not involve restarting the service, depending on whether the existing service matches config.

Drops the identified service, if it exists.

Lists the identifiers of all known services.

Watch for status changes of all known services.

Gets resource usage metrics for all processes associated with a service.

Returns Err if the entire process failed. Returns Ok(v) otherwise, with one element in v for each process of the service, even in not all metrics could be collected for all processes. In such a case, the corresponding fields of ServiceProcessMetrics will be None.

Implementors§