[][src]Trait tsunami::providers::Launcher

pub trait Launcher: Send {
    type MachineDescriptor: MachineSetup + Send;
    fn launch<'l>(
        &'l mut self,
        desc: 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>>;
fn terminate_all(
        self
    ) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send>>; 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
, { ... } }

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.

Loading content...

Required methods

fn launch<'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>>

Return connections to the Machines that launch spawned.

fn terminate_all(
    self
) -> Pin<Box<dyn Future<Output = Result<(), Report>> + Send>>

Shut down all instances.

Loading content...

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

Helper method to group MachineDescriptors 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.

Loading content...

Implementors

impl Launcher for tsunami::providers::azure::Launcher[src]

type MachineDescriptor = Setup

impl Launcher for RegionLauncher[src]

type MachineDescriptor = Setup

impl Launcher for Machine[src]

type MachineDescriptor = Setup

impl<P> Launcher for tsunami::providers::aws::Launcher<P> where
    P: ProvideAwsCredentials + Send + Sync + 'static, 
[src]

type MachineDescriptor = Setup

Loading content...