pub trait WorkerChannel: Send + Sync {
// Required methods
fn coordinator_channel<'life0, 'life1, 'async_trait>(
&'life0 mut self,
headers: HeaderMap,
set_plan_request: SetPlanRequest,
c2w_stream: BoxStream<'static, CoordinatorToWorkerMsg>,
metrics: ExecutionPlanMetricsSet,
task_ctx: &'life1 Arc<TaskContext>,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, Result<WorkerToCoordinatorMsg>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn execute_task<'life0, 'life1, 'async_trait>(
&'life0 mut self,
headers: HeaderMap,
request: ExecuteTaskRequest,
metrics: ExecutionPlanMetricsSet,
task_ctx: &'life1 Arc<TaskContext>,
) -> Pin<Box<dyn Future<Output = Result<Vec<BoxStream<'static, Result<RecordBatch>>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_worker_info<'life0, 'async_trait>(
&'life0 mut self,
request: GetWorkerInfoRequest,
) -> Pin<Box<dyn Future<Output = Result<GetWorkerInfoResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Abstraction over the specific transport protocol implementation.
WARNING: The API in this trait is unstable, and it’s subject to change as more things get properly decoupled from details like protobuf serialization and http headers.
Required Methods§
Sourcefn coordinator_channel<'life0, 'life1, 'async_trait>(
&'life0 mut self,
headers: HeaderMap,
set_plan_request: SetPlanRequest,
c2w_stream: BoxStream<'static, CoordinatorToWorkerMsg>,
metrics: ExecutionPlanMetricsSet,
task_ctx: &'life1 Arc<TaskContext>,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, Result<WorkerToCoordinatorMsg>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn coordinator_channel<'life0, 'life1, 'async_trait>(
&'life0 mut self,
headers: HeaderMap,
set_plan_request: SetPlanRequest,
c2w_stream: BoxStream<'static, CoordinatorToWorkerMsg>,
metrics: ExecutionPlanMetricsSet,
task_ctx: &'life1 Arc<TaskContext>,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, Result<WorkerToCoordinatorMsg>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Establishes a bidirectional message stream between a coordinator and a worker, over which messages will be exchanged at any time during a query’s lifetime. It’s expected to be one coordinator channel per task.
Sourcefn execute_task<'life0, 'life1, 'async_trait>(
&'life0 mut self,
headers: HeaderMap,
request: ExecuteTaskRequest,
metrics: ExecutionPlanMetricsSet,
task_ctx: &'life1 Arc<TaskContext>,
) -> Pin<Box<dyn Future<Output = Result<Vec<BoxStream<'static, Result<RecordBatch>>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute_task<'life0, 'life1, 'async_trait>(
&'life0 mut self,
headers: HeaderMap,
request: ExecuteTaskRequest,
metrics: ExecutionPlanMetricsSet,
task_ctx: &'life1 Arc<TaskContext>,
) -> Pin<Box<dyn Future<Output = Result<Vec<BoxStream<'static, Result<RecordBatch>>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Executes the requested partition range of a subplan previously sent by the coordinator channel.
Sourcefn get_worker_info<'life0, 'async_trait>(
&'life0 mut self,
request: GetWorkerInfoRequest,
) -> Pin<Box<dyn Future<Output = Result<GetWorkerInfoResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_worker_info<'life0, 'async_trait>(
&'life0 mut self,
request: GetWorkerInfoRequest,
) -> Pin<Box<dyn Future<Output = Result<GetWorkerInfoResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns metadata about a worker. Currently only used for worker versioning.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".