pub struct WorkerServiceClient<T> { /* private fields */ }Implementations§
Source§impl<T> WorkerServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> WorkerServiceClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> WorkerServiceClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
Sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
Sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
Sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
Sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
Sourcepub async fn register_worker(
&mut self,
request: impl IntoRequest<RegisterWorkerRequest>,
) -> Result<Response<RegisterWorkerResponse>, Status>
pub async fn register_worker( &mut self, request: impl IntoRequest<RegisterWorkerRequest>, ) -> Result<Response<RegisterWorkerResponse>, Status>
POST /v1/workers/register
Sourcepub async fn heartbeat(
&mut self,
request: impl IntoRequest<HeartbeatRequest>,
) -> Result<Response<HeartbeatResponse>, Status>
pub async fn heartbeat( &mut self, request: impl IntoRequest<HeartbeatRequest>, ) -> Result<Response<HeartbeatResponse>, Status>
POST /v1/workers/heartbeat — also delivers cooperative cancellations.
Sourcepub async fn poll_task(
&mut self,
request: impl IntoRequest<PollTaskRequest>,
) -> Result<Response<ExecuteTaskRequest>, Status>
pub async fn poll_task( &mut self, request: impl IntoRequest<PollTaskRequest>, ) -> Result<Response<ExecuteTaskRequest>, Status>
POST /v1/workers/poll — long poll. When no task arrived within wait_ms, HTTP answers 204 and gRPC returns an ExecuteTaskRequest with an empty token.
Sourcepub async fn complete_task(
&mut self,
request: impl IntoRequest<CompleteTaskRequest>,
) -> Result<Response<TaskResultAck>, Status>
pub async fn complete_task( &mut self, request: impl IntoRequest<CompleteTaskRequest>, ) -> Result<Response<TaskResultAck>, Status>
POST /v1/tasks/complete
Sourcepub async fn fail_task(
&mut self,
request: impl IntoRequest<FailTaskRequest>,
) -> Result<Response<TaskResultAck>, Status>
pub async fn fail_task( &mut self, request: impl IntoRequest<FailTaskRequest>, ) -> Result<Response<TaskResultAck>, Status>
POST /v1/tasks/fail
Sourcepub async fn unregister_worker(
&mut self,
request: impl IntoRequest<UnregisterWorkerRequest>,
) -> Result<Response<UnregisterWorkerResponse>, Status>
pub async fn unregister_worker( &mut self, request: impl IntoRequest<UnregisterWorkerRequest>, ) -> Result<Response<UnregisterWorkerResponse>, Status>
POST /v1/workers/unregister — in-flight tasks are redelivered elsewhere.
Trait Implementations§
Source§impl<T: Clone> Clone for WorkerServiceClient<T>
impl<T: Clone> Clone for WorkerServiceClient<T>
Auto Trait Implementations§
impl<T> !Freeze for WorkerServiceClient<T>
impl<T> Forget for WorkerServiceClient<T>
impl<T> Move for WorkerServiceClient<T>
impl<T> RefUnwindSafe for WorkerServiceClient<T>where
Grpc<T>: RefUnwindSafe,
impl<T> Send for WorkerServiceClient<T>
impl<T> Sync for WorkerServiceClient<T>
impl<T> Unpin for WorkerServiceClient<T>
impl<T> UnsafeUnpin for WorkerServiceClient<T>where
Grpc<T>: UnsafeUnpin,
impl<T> UnwindSafe for WorkerServiceClient<T>where
Grpc<T>: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request