pub trait NamespacedOrchestrator: Debug + Send + Sync {
    // Required methods
    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;
    fn update_scheduling_config(&self, config: ServiceSchedulingConfig);
}
Expand description

An orchestrator restricted to a single namespace.

Required Methods§

source

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,

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.

source

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,

Drops the identified service, if it exists.

source

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,

Lists the identifiers of all known services.

source

fn watch_services(&self) -> BoxStream<'static, Result<ServiceEvent, Error>>

Watch for status changes of all known services.

source

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,

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.

source

fn update_scheduling_config(&self, config: ServiceSchedulingConfig)

Implementors§