pub struct TasksServiceClient<T> { /* private fields */ }Expand description
Orchestrator-hosted service that workers connect to for receiving tasks.
This service runs on the orchestrator (or any stateless dispatcher with access to the task queue). Workers are clients of this service — they call PullTasks to receive work.
Static worker configuration (blob service URL, blobification threshold, etc.) is provided via environment variables at deployment time. Only per-task information (e.g., the run-owning orchestrator URL) is sent in-band via TaskContext.
Workers report task completion via OrchestratorService.CompleteTask, which must reach the orchestrator that owns the specific run (URL provided per-task in TaskContext).
gRPC only — not exposed as REST.
Implementations§
Source§impl<T> TasksServiceClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> TasksServiceClient<T>where
T: GrpcService<Body>,
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,
) -> TasksServiceClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<Body>, Response = Response<<T as GrpcService<Body>>::ResponseBody>>,
<T as Service<Request<Body>>>::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 pull_tasks(
&mut self,
request: impl IntoRequest<PullTasksRequest>,
) -> Result<Response<Streaming<TaskAssignment>>, Status>
pub async fn pull_tasks( &mut self, request: impl IntoRequest<PullTasksRequest>, ) -> Result<Response<Streaming<TaskAssignment>>, Status>
Pull task assignments for a specific plugin.
The worker specifies which plugin entry it is pulling for (by name from the orchestrator’s config). The orchestrator validates that the plugin uses a compatible transport (e.g., “pull”). If the plugin uses a queue-based transport (e.g., NATS, Kafka), this RPC returns FAILED_PRECONDITION.
The worker declares its concurrency limit. The stream stays open for the worker’s lifetime — tasks are sent as they become available.
Sourcepub async fn get_orchestrator_for_run(
&mut self,
request: impl IntoRequest<GetOrchestratorForRunRequest>,
) -> Result<Response<GetOrchestratorForRunResponse>, Status>
pub async fn get_orchestrator_for_run( &mut self, request: impl IntoRequest<GetOrchestratorForRunRequest>, ) -> Result<Response<GetOrchestratorForRunResponse>, Status>
Look up the current orchestrator for a run.
Workers call this when they cannot reach the orchestrator URL from their TaskContext (e.g., after an orchestrator restart or run migration). Any orchestrator can answer this — it performs a stateless lease lookup.
Returns the gRPC service URL of the orchestrator that currently owns the run, or NOT_FOUND if no active lease exists.
Trait Implementations§
Source§impl<T: Clone> Clone for TasksServiceClient<T>
impl<T: Clone> Clone for TasksServiceClient<T>
Source§fn clone(&self) -> TasksServiceClient<T>
fn clone(&self) -> TasksServiceClient<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<T> !Freeze for TasksServiceClient<T>
impl<T> RefUnwindSafe for TasksServiceClient<T>where
T: RefUnwindSafe,
impl<T> Send for TasksServiceClient<T>where
T: Send,
impl<T> Sync for TasksServiceClient<T>where
T: Sync,
impl<T> Unpin for TasksServiceClient<T>where
T: Unpin,
impl<T> UnsafeUnpin for TasksServiceClient<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for TasksServiceClient<T>where
T: UnwindSafe,
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request