Skip to main content

task_request_reader

Reads the task requests a pod receives.

Shared by the v8 worker path and the interactive-DAG handler, which read a JOB_REQUEST the same way.

Classes​

TaskRequestReader​

class TaskRequestReader(ctx: PodContext):

Unpacks a task request, works out which datasource it addresses, and rejects it.

Arguments

  • ctx: The pod's identity and services.

Methods​


determine_target_data_identifiers​

def determine_target_data_identifiers(    self, message: _BitfountMessage,) ‑> tuple[str, str | None]:

Determine the target data identifiers for the task request.

extract_requested_datasource​

def extract_requested_datasource(self, message: _BitfountMessage) ‑> str | None:

Extract the requested datasource from task request message.

Returns None if the requested datasource cannot be found, otherwise the datasource name.

patch​

def patch(self, task_request_message: _TaskRequestMessage) ‑> None:

Patch the task request message with default values.

reject_with_error​

async def reject_with_error(    self,    message: _BitfountMessage,    error_message: str,    response_type: _PodResponseType = _PodResponseType.TASK_SETUP_ERROR,    *,    mailbox: _PodMailbox | None,) ‑> None:

Reject a task with an error message.

Prevents the task from remaining in Waiting state.

Arguments

  • message: The incoming message containing task details.
  • error_message: The error message to include in the rejection.
  • response_type: The type of response to send (defaults to TASK_SETUP_ERROR).
  • mailbox: The pod's mailbox, which carries the rejection.

unpack​

def unpack(    self, message: _BitfountMessage,) ‑> bitfount.federated.task_requests._TaskRequest:

Unpack the task request message.