pub struct Worker { /* private fields */ }Expand description
Worker node for executing distributed tasks.
Implementations§
Source§impl Worker
impl Worker
Sourcepub fn new(config: WorkerConfig) -> Self
pub fn new(config: WorkerConfig) -> Self
Create a new worker.
Sourcepub fn status(&self) -> WorkerStatus
pub fn status(&self) -> WorkerStatus
Get the current status.
Sourcepub fn metrics(&self) -> WorkerMetrics
pub fn metrics(&self) -> WorkerMetrics
Get the current metrics.
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Check if the worker is available for new tasks.
Sourcepub async fn execute_task(
&self,
task: Task,
data: Arc<RecordBatch>,
) -> Result<TaskResult>
pub async fn execute_task( &self, task: Task, data: Arc<RecordBatch>, ) -> Result<TaskResult>
Execute a task.
Sourcepub async fn start_heartbeat(&self, heartbeat_tx: Sender<String>) -> Result<()>
pub async fn start_heartbeat(&self, heartbeat_tx: Sender<String>) -> Result<()>
Start the worker’s heartbeat loop.
Sourcepub fn health_check(&self) -> WorkerHealthCheck
pub fn health_check(&self) -> WorkerHealthCheck
Get health check information.
Auto Trait Implementations§
impl Freeze for Worker
impl RefUnwindSafe for Worker
impl Send for Worker
impl Sync for Worker
impl Unpin for Worker
impl UnsafeUnpin for Worker
impl UnwindSafe for Worker
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
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>
Wrap the input message
T in a tonic::Request