nv_ingest_api.util.message_brokers package#
Subpackages#
- nv_ingest_api.util.message_brokers.simple_message_broker package
Submodules#
nv_ingest_api.util.message_brokers.qos_scheduler module#
- class nv_ingest_api.util.message_brokers.qos_scheduler.QosScheduler(
- base_queue: str,
- total_buffer_capacity: int = 1,
- num_prefetch_threads: int = 0,
- prefetch_poll_interval: float = 0.0,
- prefetch_non_immediate: bool = False,
- strategy: str = 'lottery',
- prioritize_immediate: bool = True,
Bases:
objectSimplified scheduler that fetches jobs from the default queue only. Uses the provided timeout value when polling the broker.
- close() None[source]#
Cleanly close the scheduler. No-op for the current implementation since we do not spin background threads.
- fetch_next(client, timeout: float = 0.0) dict | None[source]#
Immediate-first, then strategy-based scheduling among non-immediate queues.
Behavior: - Always check ‘immediate’ first (non-blocking). If present, return immediately. - If not, select using the configured strategy (lottery, round_robin, weighted_round_robin). - If no job is found in a full pass:
If timeout <= 0: return None.
Else: sleep in 0.5s increments and retry until accumulated elapsed time >= timeout.