Skip to main content

job_request_dispatcher

Receives the JOB_REQUESTs a pod is sent and routes each one.

Every request gets the same handling first: background schema generation is held off, datasource configuration changes are picked up, and a request that has waited too long is rejected. A request that triggers an interactive DAG then goes to the interactive handler; anything else is a v8 federated task.

Classes​

JobRequestDispatcher​

class JobRequestDispatcher(    *,    reader: TaskRequestReader,    interactive: InteractiveRouter,    v8: V8TaskRunner,    holds: SchemaGenerationHolds,    config_reloader: DatasourceConfigReloader,    mailbox: Callable[[], _PodMailbox | None],):

Routes each JOB_REQUEST to the interactive handler or the v8 runner.

Arguments

  • reader: Reads, and rejects, the task requests.
  • interactive: Takes a JOB_REQUEST that triggers an interactive DAG.
  • v8: Runs every other JOB_REQUEST as a v8 federated task.
  • holds: Keeps background schema generation off while a request is handled.
  • config_reloader: Picks up datasource configuration changes before a request is handled.
  • mailbox: Returns the pod's mailbox, which is set once the pod has started.

Variables​

  • is_busy : bool - True while a JOB_REQUEST is being handled.

Methods​


handle​

async def handle(self, message: _BitfountMessage) ‑> None:

Called on new task request being received from message service.