Skip to main content

ClusterSpec

Trait ClusterSpec 

Source
pub trait ClusterSpec:
    Clone
    + Send
    + Sync
    + 'static {
    type Command: Debug + Send + TryIntoProtocolNonce;
    type Response: Debug + Send;

    const NAME: &str;

    // Required method
    fn run_worker(
        &self,
        timely_worker: &mut TimelyWorker,
        client_rx: UnboundedReceiver<(Uuid, UnboundedReceiver<Self::Command>, UnboundedSender<Self::Response>)>,
    );

    // Provided method
    fn build_cluster<'life0, 'async_trait>(
        &'life0 self,
        config: TimelyConfig,
        tokio_executor: Handle,
    ) -> Pin<Box<dyn Future<Output = Result<TimelyContainer<Self>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Specification for a Timely cluster to which a ClusterClient connects.

This trait is used to make the ClusterClient generic over the compute and storage cluster implementations.

Required Associated Constants§

Source

const NAME: &str

The name of this cluster (“compute” or “storage”).

Required Associated Types§

Source

type Command: Debug + Send + TryIntoProtocolNonce

The cluster command type.

Source

type Response: Debug + Send

The cluster response type.

Required Methods§

Source

fn run_worker( &self, timely_worker: &mut TimelyWorker, client_rx: UnboundedReceiver<(Uuid, UnboundedReceiver<Self::Command>, UnboundedSender<Self::Response>)>, )

Run the given Timely worker.

Provided Methods§

Source

fn build_cluster<'life0, 'async_trait>( &'life0 self, config: TimelyConfig, tokio_executor: Handle, ) -> Pin<Box<dyn Future<Output = Result<TimelyContainer<Self>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Build a Timely cluster using the given config.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§