pub struct Executor { /* private fields */ }
Expand description
The executor event loop and the set of registered tasks.
Implementations§
Source§impl Executor
impl Executor
Sourcepub fn new(executor_type: &str) -> Self
pub fn new(executor_type: &str) -> Self
Create a executor based on env variables RAIN_EXECUTOR_ID
and RAIN_EXECUTOR_SOCKET
and working dir in the current directory. See also Executor::with_params
.
Panics when either env variable is missing or invalid.
Sourcepub fn with_params(
executor_type: &str,
executor_id: ExecutorId,
socket_path: &Path,
working_dir: &Path,
) -> Self
pub fn with_params( executor_type: &str, executor_id: ExecutorId, socket_path: &Path, working_dir: &Path, ) -> Self
Creates a Sbgovernor with the given attributes. Note that the attributes are only recorded at this point and no initialization is performed.
Sourcepub fn register_task<S, F>(&mut self, task_name: S, task_fun: F)where
S: Into<String>,
F: 'static + Fn(&mut Context, &[DataInstance], &mut [Output]) -> TaskResult<()> + Send + Sync,
pub fn register_task<S, F>(&mut self, task_name: S, task_fun: F)where
S: Into<String>,
F: 'static + Fn(&mut Context, &[DataInstance], &mut [Output]) -> TaskResult<()> + Send + Sync,
Register task function.
The provided function must accept a list of inpts and outputs, expanding them manually.
For functions accepting individual inputs and outputs, see the macro register_task!
.
The accepted function type is equivalent to 'static + TaskFn
.
Panics when a task with the same name has been registered previously.
Auto Trait Implementations§
impl Freeze for Executor
impl !RefUnwindSafe for Executor
impl Send for Executor
impl Sync for Executor
impl Unpin for Executor
impl !UnwindSafe for Executor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more