[−][src]Trait tsunami::providers::Launcher
Use this trait to implement support for launching machines in a cloud provider.
If you just want to launch machines, use crate::Tsunami
instead of this trait.
Associated Types
type MachineDescriptor: MachineSetup + Send
A type describing a single instance to launch.
Required methods
fn launch<'l>(
&'l mut self,
desc: LaunchDescriptor<Self::MachineDescriptor>
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'l>>
&'l mut self,
desc: LaunchDescriptor<Self::MachineDescriptor>
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'l>>
Spawn the instances.
Implementations can assume that all the entries in desc
are for the same region.
Implementors should remember enough information to subsequently answer
calls to connect_all
, i.e., the IPs of the machines.
This method can be called multiple times. Subsequent calls to
connect_all
should return the new machines as well as any previously
spawned machines.
fn connect_all<'l>(
&'l self
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Machine<'l>>, Report>> + Send + 'l>>
&'l self
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Machine<'l>>, Report>> + Send + 'l>>
Return connections to the Machine
s that launch
spawned.
fn terminate_all(
self
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send>>
self
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send>>
Shut down all instances.
Provided methods
fn spawn<'l, I>(
&'l mut self,
descriptors: I,
max_wait: Option<Duration>
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'l>> where
I: IntoIterator<Item = (String, Self::MachineDescriptor)> + Send + 'static,
I: Debug,
I::IntoIter: Send,
&'l mut self,
descriptors: I,
max_wait: Option<Duration>
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'l>> where
I: IntoIterator<Item = (String, Self::MachineDescriptor)> + Send + 'static,
I: Debug,
I::IntoIter: Send,
Helper method to group MachineDescriptor
s into regions and call launch
.
This implementation initializes each region serially. It may be useful for performance to provide an implementation that initializes the regions concurrently.
Implementors
impl Launcher for tsunami::providers::azure::Launcher
[src]
type MachineDescriptor = Setup
fn launch<'l>(
&'l mut self,
l: LaunchDescriptor<Self::MachineDescriptor>
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'l>>
[src]
&'l mut self,
l: LaunchDescriptor<Self::MachineDescriptor>
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'l>>
fn connect_all<'l>(
&'l self
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Machine<'l>>, Report>> + Send + 'l>>
[src]
&'l self
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Machine<'l>>, Report>> + Send + 'l>>
fn terminate_all(
self
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send>>
[src]
self
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send>>
impl Launcher for RegionLauncher
[src]
type MachineDescriptor = Setup
fn launch<'l>(
&'l mut self,
l: LaunchDescriptor<Self::MachineDescriptor>
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'l>>
[src]
&'l mut self,
l: LaunchDescriptor<Self::MachineDescriptor>
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'l>>
fn connect_all<'l>(
&'l self
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Machine<'l>>, Report>> + Send + 'l>>
[src]
&'l self
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Machine<'l>>, Report>> + Send + 'l>>
fn terminate_all(
self
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send>>
[src]
self
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send>>
impl Launcher for Machine
[src]
type MachineDescriptor = Setup
fn launch<'l>(
&'l mut self,
l: LaunchDescriptor<Self::MachineDescriptor>
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'l>>
[src]
&'l mut self,
l: LaunchDescriptor<Self::MachineDescriptor>
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'l>>
fn connect_all<'l>(
&'l self
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Machine<'l>>, Report>> + Send + 'l>>
[src]
&'l self
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Machine<'l>>, Report>> + Send + 'l>>
fn terminate_all(
self
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send>>
[src]
self
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send>>
impl<P> Launcher for tsunami::providers::aws::Launcher<P> where
P: ProvideAwsCredentials + Send + Sync + 'static,
[src]
P: ProvideAwsCredentials + Send + Sync + 'static,
type MachineDescriptor = Setup
fn launch<'l>(
&'l mut self,
l: LaunchDescriptor<Self::MachineDescriptor>
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'l>>
[src]
&'l mut self,
l: LaunchDescriptor<Self::MachineDescriptor>
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'l>>
fn spawn<'l, I>(
&'l mut self,
descriptors: I,
max_wait: Option<Duration>
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'l>> where
I: IntoIterator<Item = (String, Self::MachineDescriptor)> + Send + 'static,
I: Debug,
I::IntoIter: Send,
[src]
&'l mut self,
descriptors: I,
max_wait: Option<Duration>
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send + 'l>> where
I: IntoIterator<Item = (String, Self::MachineDescriptor)> + Send + 'static,
I: Debug,
I::IntoIter: Send,
fn connect_all<'l>(
&'l self
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Machine<'l>>, Report>> + Send + 'l>>
[src]
&'l self
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Machine<'l>>, Report>> + Send + 'l>>
fn terminate_all(
self
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send>>
[src]
self
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send>>