Skip to main content

NewIndexedWorkQueue

Instantiates a new Indexed Work queue.

def NewIndexedWorkQueue(
name: string,
processor: Processor,
cfg: Config,
metricsScope: promutils.Scope
) - > IndexedWorkQueue, error

Instantiates a new Indexed Work queue.

Parameters

NameTypeDescription
namestringThe name of the work queue, used for identification and metrics.
processorProcessorThe Processor interface implementation that will handle the work items from the queue.
cfgConfigThe configuration settings for the work queue, including cache size, number of workers, and maximum retries.
metricsScopepromutils.ScopeThe Prometheus metrics scope used for reporting metrics related to the work queue's operation.

Returns

TypeDescription
IndexedWorkQueue, errorA new IndexedWorkQueue instance or an error if the cache cannot be initialized.