Skip to content

Detection Worker Factory Adapter

app.application.adapters.detection_worker_factory_adapter

View source code

Adapt the detection-worker factory contract to infrastructure.

See Also

Layer: Application adapter. Context: Creates the infrastructure worker lazily, keeping its concrete type behind the application interface.

DetectionWorkerFactoryAdapter

Bases: DetectionWorkerFactoryInterface

Create concrete DetectionWorker instances behind an interface seam.

Layer: Application. Context: Coordinates use-case behavior through domain services and application contracts.

create(session_id: SessionId, detection_engine: DetectionEngineInterface) -> DetectionWorkerInterface

Create an infrastructure detection worker behind its interface.

PARAMETER DESCRIPTION
session_id

Session that owns the detection work.

TYPE: SessionId

detection_engine

Engine used to run frame inference.

TYPE: DetectionEngineInterface

RETURNS DESCRIPTION
DetectionWorkerInterface

Worker adapter implementing DetectionWorkerInterface.