pop_strategy
JobPopStrategyGeneric
Bases: ABC
Abstract base class for job pop strategies.
Source code in horde_sdk/worker/dispatch/pop_strategy.py
__init__
Initialize the job pop strategy.
get_worker_type
abstractmethod
Get the worker type associated with this job pop strategy.
Returns:
-
WORKER_TYPE(WORKER_TYPE) –The worker type.
get_dispatch_source
abstractmethod
Get the dispatch source associated with this job pop strategy.
Returns:
-
KNOWN_DISPATCH_SOURCE | str–KNOWN_DISPATCH_SOURCE | str: The dispatch source.
pop_job
abstractmethod
Pop a job synchronously from the dispatch source.
Use async_pop_job for asynchronous operations.
Returns:
-
HordeWorkerJob[HordeSingleGeneration[Any], CompositeParametersBase] | None–HordeWorkerJob[HordeSingleGeneration[Any], CompositeParametersBase] | None: The popped job or
Noneif -
HordeWorkerJob[HordeSingleGeneration[Any], CompositeParametersBase] | None–no job is available.
Source code in horde_sdk/worker/dispatch/pop_strategy.py
async_pop_job
abstractmethod
async
Pop a job asynchronously from the dispatch source.
Use pop_job if you prefer synchronous operations.
Returns:
-
HordeWorkerJob[HordeSingleGeneration[Any], CompositeParametersBase] | None–HordeWorkerJob[HordeSingleGeneration[Any], CompositeParametersBase] | None: The popped job or
Noneif -
HordeWorkerJob[HordeSingleGeneration[Any], CompositeParametersBase] | None–no job is available.