ensembl.vep.workflow.worker package#
Process-local runtimes an executor runs payloads against.
Submodules#
ensembl.vep.workflow.worker.annotation module#
The annotation worker: a payload of unparsed input records in, detached annotations out.
One worker per process, built after the process starts, holding what every track shares: the reference sequence, the synonym map, the input source turning lines into variations, and the output factory detaching what a payload produced. Which annotations are made, and from which sources, belongs to the workflow’s tracks rather than here.
The input source is what reads: the worker hands it one payload’s records and is given variations back, so which format the input is in, and what a record of it is, stays with the source.
- class ensembl.vep.workflow.worker.annotation.AnnotationBufferResult(*, variants, summary_delta)[source]#
Bases:
objectOrdered worker result detached from live model objects.
- Variables:
variants (tuple[AnnotatedVariant, ...]) – Detached annotated variants.
summary_delta (RunSummaryDelta) – Mergeable run-summary counts.
- summary_delta: RunSummaryDelta#
- variants: tuple[AnnotatedVariant, ...]#
- class ensembl.vep.workflow.worker.annotation.AnnotationBufferWorker(config)[source]#
Bases:
objectWorker-local sources and workflow state for payloads of input records.
The
Workerprotocol’srunfor annotation, which is why nothing here is constructed until the process that annotates owns it: sources are opened and caches warmed per process.
ensembl.vep.workflow.worker.base module#
The worker contract: one payload in, one serialisable result out.
- class ensembl.vep.workflow.worker.base.Worker[PayloadT_contra, ResultT_co](*args, **kwargs)[source]#
Bases:
Protocol[PayloadT_contra,ResultT_co]Process-local runtime that runs one payload at a time.
A worker is built once per process, after that process starts, and then reused: it holds open sources and warm caches that neither cross a process boundary nor survive a rebuild. So what the executor transports is the factory, never the worker, and the worker itself never has to be serialisable – only its payloads and its results do.
One method, because that is all an executor needs of it. What a payload holds, and what the result carries, belongs to the kind of work:
AnnotationBufferWorkertakes a payload of input records and answers with detached annotations.