[−][src]Struct flowrlib::coordinator::Coordinator
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]
num_threads: usize,
native: bool,
server_only: bool,
client_only: bool,
server_hostname: Option<&str>
) -> Result<(RuntimeClientConnection, DebugClientConnection)>
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
impl !RefUnwindSafe for Coordinator[src]
impl Send for Coordinator[src]
impl !Sync for Coordinator[src]
impl Unpin for Coordinator[src]
impl !UnwindSafe for Coordinator[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,