[][src]Struct flowrlib::coordinator::Coordinator

pub struct Coordinator { /* fields omitted */ }

The Coordinator is responsible for coordinating the dispatching of jobs (consisting of a set of Input values and an Implementation of a Function) for execution, gathering the resulting Outputs and distributing output values to other connected function's Inputs.

It accepts Flows to be executed in the form of a Submission struct that has the required information to execute the flow.

Implementations

impl Coordinator[src]

Create a Submission for a flow to be executed. Instantiate the Coordinator. Send the Submission to the Coordinator to be executed

Examples

use std::sync::{Arc, Mutex};
use std::io;
use std::io::Write;
use flowrlib::coordinator::{Coordinator, Submission};
use std::process::exit;
use flowrstructs::manifest::{Manifest, MetaData};
use flowrlib::runtime::Response as RuntimeResponse;
use flowrlib::runtime::Event as RuntimeEvent;
use flowrlib::runtime::Response::ClientSubmission;

let (runtime_client_connection, debug_client_connection) = Coordinator::server(1 /* num_threads */,
                                                                    true,  /* native */
                                                                    false, /* server-only */
                                                                    false, /* client-only */
                                                                    None   /* server hostname */)
                                                .unwrap();

let mut submission = Submission::new("file:///temp/fake.toml",
                                    1 /* num_parallel_jobs */,
                                    true /* enter debugger on start */);


runtime_client_connection.client_send(ClientSubmission(submission)).unwrap();
exit(0);

pub fn server(
    num_threads: usize,
    native: bool,
    server_only: bool,
    client_only: bool,
    server_hostname: Option<&str>
) -> Result<(RuntimeClientConnection, DebugClientConnection)>
[src]

Start the Coordinator server either in a background thread or in the foreground thread this function is called on according to the server parameter: server_only == true -> this is a server-only process, start the server on this thread server_only == false -> this process works as client AND server, start serving from a thread client_only == true -> No need to start any Coordinator server, just return connections

pub fn start(&mut self, native: bool, server_only: bool) -> Result<()>[src]

Start the Coordinator - this will block the thread it is running on waiting for a submission It will loop processing submissions until it gets a ClientExiting response, then it will also exit

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.