Trait specifications::working::JobService
source · pub trait JobService:
'static
+ Send
+ Sync {
type ExecuteStream: 'static + Send + Stream<Item = Result<ExecuteReply, Status>>;
// Required methods
fn check_workflow<'life0, 'async_trait>(
&'life0 self,
request: Request<CheckWorkflowRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CheckReply>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn check_task<'life0, 'async_trait>(
&'life0 self,
request: Request<CheckTaskRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CheckReply>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn preprocess<'life0, 'async_trait>(
&'life0 self,
request: Request<PreprocessRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<PreprocessReply>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn execute<'life0, 'async_trait>(
&'life0 self,
request: Request<ExecuteRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ExecuteStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn commit<'life0, 'async_trait>(
&'life0 self,
request: Request<CommitRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CommitReply>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
The JobService is a trait for easily writing a service for the driver communication protocol.
Implementation based on the auto-generated version from tonic.
Required Associated Types§
sourcetype ExecuteStream: 'static + Send + Stream<Item = Result<ExecuteReply, Status>>
type ExecuteStream: 'static + Send + Stream<Item = Result<ExecuteReply, Status>>
The response type for stream returned by JobService::execute()
.
Required Methods§
sourcefn check_workflow<'life0, 'async_trait>(
&'life0 self,
request: Request<CheckWorkflowRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CheckReply>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check_workflow<'life0, 'async_trait>(
&'life0 self,
request: Request<CheckWorkflowRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CheckReply>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle for when a CheckWorkflowRequest
comes in.
§Arguments
request
: The (tonic::Request
-wrapped)CheckWorkflowRequest
containing the relevant details.
§Returns
A CheckReply
for this request, wrapped in a tonic::Response
.
§Errors
This function may error (i.e., send back a tonic::Status
) whenever it fails.
sourcefn check_task<'life0, 'async_trait>(
&'life0 self,
request: Request<CheckTaskRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CheckReply>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check_task<'life0, 'async_trait>(
&'life0 self,
request: Request<CheckTaskRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CheckReply>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle for when a CheckTaskRequest
comes in.
§Arguments
request
: The (tonic::Request
-wrapped)CheckTaskRequest
containing the relevant details.
§Returns
A CheckReply
for this request, wrapped in a tonic::Response
.
§Errors
This function may error (i.e., send back a tonic::Status
) whenever it fails.
sourcefn preprocess<'life0, 'async_trait>(
&'life0 self,
request: Request<PreprocessRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<PreprocessReply>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn preprocess<'life0, 'async_trait>(
&'life0 self,
request: Request<PreprocessRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<PreprocessReply>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle for when a PreprocessRequest comes in.
§Arguments
request
: The (tonic::Request
-wrapped) PreprocessRequest containing the relevant details.
§Returns
A PreprocessReply for this request, wrapped in a tonic::Response
.
§Errors
This function may error (i.e., send back a tonic::Status
) whenever it fails.
sourcefn execute<'life0, 'async_trait>(
&'life0 self,
request: Request<ExecuteRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ExecuteStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
request: Request<ExecuteRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<Self::ExecuteStream>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle for when an ExecuteRequest comes in.
§Arguments
request
: The (tonic::Request
-wrapped) ExecuteRequest containing the relevant details.
§Returns
A stream of ExecuteReply messages, updating the client and eventually sending back the workflow result.
§Errors
This function may error (i.e., send back a tonic::Status
) whenever it fails.