Skip to main content

SubmissionHandler

Trait SubmissionHandler 

Source
pub trait SubmissionHandler {
    // Required methods
    fn flow_execution_starting(&mut self) -> Result<()>;
    fn should_enter_debugger(&mut self) -> Result<bool>;
    fn flow_execution_ended(
        &mut self,
        state: &RunState,
        metrics: Metrics,
    ) -> Result<()>;
    fn wait_for_submission(&mut self) -> Result<Option<Submission>>;
    fn coordinator_is_exiting(&mut self, result: Result<()>) -> Result<()>;

    // Provided methods
    fn should_stop(&mut self) -> Result<bool> { ... }
    fn jobs_created(&mut self, _count: usize) { ... }
}
Expand description

Programs that wish to submit a flow for execution via a Submission and then track it’s execution (such as a CLI or a UI) should implement this trait

Required Methods§

Source

fn flow_execution_starting(&mut self) -> Result<()>

Execution of the flow is starting

§Errors

Returns an error if the message corresponding to the flow is starting cannot be sent

Source

fn should_enter_debugger(&mut self) -> Result<bool>

The Coordinator executing the flow periodically will check if there has been a request to enter the debugger.

§Errors

Returns an error if the request to check if debugger entry is required fails

Source

fn flow_execution_ended( &mut self, state: &RunState, metrics: Metrics, ) -> Result<()>

The Coordinator informs the submitter that the execution of the flow has ended

§Errors

Returns an error if the message corresponding to the flow has ended cannot be sent

Source

fn wait_for_submission(&mut self) -> Result<Option<Submission>>

The Coordinator wait for a Submission to be sent for execution

§Errors

Returns an error if there is an error while waiting for a submission (usually networking9

Source

fn coordinator_is_exiting(&mut self, result: Result<()>) -> Result<()>

The Coordinator is about to exit

§Errors

Will return Err if this cannot be communicated to the client

Provided Methods§

Source

fn should_stop(&mut self) -> Result<bool>

The Coordinator periodically checks if the client has requested that execution be stopped.

§Errors

Returns an error if the check fails

Source

fn jobs_created(&mut self, _count: usize)

Called by the Coordinator after jobs are retired, with the total number of jobs created so far. Default implementation is a no-op.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§