vlocode-project - v1.40.0-beta-4
    Preparing search index...

    Class DeferredWorkQueue<TRequest, TResolve>

    Deferred work processor class which queues work items and returns an awaitable deferred promise. This class supports bulkification of otherwise singular work items. A processor function/delegate is passed which will process all queue items in bulk. Optionally a chunk size can be specified which determines the size of the chunks passed to the processor delegate.

    Type Parameters

    • TRequest
    • TResolve
    Index

    Constructors

    Properties

    chunkSize: undefined | number = undefined

    Size of the chunks

    processing: boolean = false
    processingQueue: Map<
        number,
        {
            deferred: DeferredPromise<undefined | TResolve>;
            id: number;
            request: TRequest;
        },
    > = ...

    Set of items that is currently being processed

    processor: (
        requests: TRequest[],
    ) => Promise<WorkItemResult<undefined | TResolve>[]>

    Processor fn

    processWaitTime: number = 50

    Time to wait until executing the queued lookups

    queueTimer?: Timeout
    requestIdRef: number = 0

    Used to keep track of work items

    requestQueue: {
        deferred: DeferredPromise<undefined | TResolve>;
        id: number;
        request: TRequest;
    }[] = ...

    Queue with items that are going to be worked upon

    Methods