Struct splinter::orchestrator::ServiceOrchestrator
source · [−]pub struct ServiceOrchestrator { /* private fields */ }
Expand description
The ServiceOrchestrator
manages initialization and shutdown of services.
Implementations
sourceimpl ServiceOrchestrator
impl ServiceOrchestrator
sourcepub fn new(
service_factories: Vec<Box<dyn OrchestratableServiceFactory>>,
connection: Box<dyn Connection>,
incoming_capacity: usize,
outgoing_capacity: usize,
channel_capacity: usize
) -> Result<Self, NewOrchestratorError>
👎 Deprecated since 0.5.1: please use ServiceOrchestratorBuilder
instead
pub fn new(
service_factories: Vec<Box<dyn OrchestratableServiceFactory>>,
connection: Box<dyn Connection>,
incoming_capacity: usize,
outgoing_capacity: usize,
channel_capacity: usize
) -> Result<Self, NewOrchestratorError>
please use ServiceOrchestratorBuilder
instead
Create a new ServiceOrchestrator
. This starts up 3 threads for relaying messages to and
from services. Returns the ServiceOrchestrator
and the threads JoinHandles
pub fn take_shutdown_handle(
&mut self
) -> Option<ServiceOrchestratorShutdownHandle>
sourcepub fn initialize_service(
&self,
service_definition: ServiceDefinition,
args: HashMap<String, String>
) -> Result<(), InitializeServiceError>
pub fn initialize_service(
&self,
service_definition: ServiceDefinition,
args: HashMap<String, String>
) -> Result<(), InitializeServiceError>
Initialize (create and start) a service according to the specified definition. The arguments provided must match those required to create the service.
sourcepub fn stop_service(
&self,
service_definition: &ServiceDefinition
) -> Result<(), ShutdownServiceError>
pub fn stop_service(
&self,
service_definition: &ServiceDefinition
) -> Result<(), ShutdownServiceError>
Stop the specified service.
sourcepub fn purge_service(
&self,
service_definition: &ServiceDefinition
) -> Result<(), InternalError>
pub fn purge_service(
&self,
service_definition: &ServiceDefinition
) -> Result<(), InternalError>
Purge the specified service state, based on its service implementation.
sourcepub fn shutdown_all_services(&self) -> Result<(), ShutdownServiceError>
pub fn shutdown_all_services(&self) -> Result<(), ShutdownServiceError>
Shut down (stop and destroy) all services managed by this ServiceOrchestrator
and single
the ServiceOrchestrator
to shutdown
sourcepub fn list_services(
&self,
circuits: Vec<String>,
service_types: Vec<String>
) -> Result<Vec<ServiceDefinition>, ListServicesError>
pub fn list_services(
&self,
circuits: Vec<String>,
service_types: Vec<String>
) -> Result<Vec<ServiceDefinition>, ListServicesError>
List services managed by this ServiceOrchestrator
; filters may be provided to only show
services on specified circuit(s) and of given service type(s).
sourcepub fn add_stopped_service(
&self,
service_definition: ServiceDefinition,
args: HashMap<String, String>
) -> Result<(), AddServiceError>
pub fn add_stopped_service(
&self,
service_definition: ServiceDefinition,
args: HashMap<String, String>
) -> Result<(), AddServiceError>
Create a service that has previously been stopped according to the specified definition. The arguments provided must match those required to create the service.
pub fn supported_service_types(&self) -> &[String]
Trait Implementations
sourceimpl RestResourceProvider for ServiceOrchestrator
impl RestResourceProvider for ServiceOrchestrator
The ServiceOrchestrator
exposes REST API resources provided by the
ServiceFactory::get_rest_endpoints
methods of its factories. Each factory defines the
endpoints provided by the services it creates; the ServiceOrchestrator
then exposes these
endpoints under the /{service_type}/{circuit}/{service_id}
route.
Auto Trait Implementations
impl !RefUnwindSafe for ServiceOrchestrator
impl Send for ServiceOrchestrator
impl !Sync for ServiceOrchestrator
impl Unpin for ServiceOrchestrator
impl !UnwindSafe for ServiceOrchestrator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<P, N> IntoBytes<P> for N where
P: Message + FromNative<N>,
impl<P, N> IntoBytes<P> for N where
P: Message + FromNative<N>,
fn into_bytes(self) -> Result<Vec<u8, Global>, ProtoConversionError>
sourceimpl<N, P> IntoNative<N> for P where
N: FromProto<P>,
impl<N, P> IntoNative<N> for P where
N: FromProto<P>,
fn into_native(self) -> Result<N, ProtoConversionError>
sourceimpl<N, P> IntoProto<P> for N where
P: FromNative<N>,
impl<N, P> IntoProto<P> for N where
P: FromNative<N>,
fn into_proto(self) -> Result<P, ProtoConversionError>
sourceimpl<T> IntoSql for T
impl<T> IntoSql for T
sourcefn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
Convert self
to an expression for Diesel’s query builder. Read more
sourcefn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
Convert &self
to an expression for Diesel’s query builder. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more