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
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: '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
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn list_services<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn watch_services(&self) -> BoxStream<'static, Result<ServiceEvent, Error>>;
}
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.
fn watch_services(&self) -> BoxStream<'static, Result<ServiceEvent, Error>>
fn watch_services(&self) -> BoxStream<'static, Result<ServiceEvent, Error>>
Watch for status changes of all known services.