pub struct Executor { /* private fields */ }
Expand description
An Executor
struct is used to receive jobs, execute them and return results.
It can load libraries and keep track of the Function
Implementations
loaded for use
in job execution.
Implementations§
source§impl Executor
impl Executor
sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create a new executor that receives jobs, executes them and returns results.
sourcepub fn add_lib(
&mut self,
lib_manifest: LibraryManifest,
resolved_url: Url
) -> Result<()>
pub fn add_lib( &mut self, lib_manifest: LibraryManifest, resolved_url: Url ) -> Result<()>
Add a library manifest so that it can be used later on to load implementations that are required to execute jobs. Also provide the Url that the library url resolves to, so that later it can be used when resolving the locations of implementations in this library.
sourcepub fn start(
&mut self,
provider: Arc<dyn Provider>,
number_of_executors: usize,
job_service: &str,
results_service: &str,
control_service: &str
)
pub fn start( &mut self, provider: Arc<dyn Provider>, number_of_executors: usize, job_service: &str, results_service: &str, control_service: &str )
Start executing jobs, specifying:
- the
Provider
to use to fetch implementation content - the number of executor threads
- the address of the job socket to get jobs from
- the address of the results socket to return results from executed jobs to