RequestManagerTandem
Implements
Index
Constructors
constructor
Parameters
requestList: IRequestList
requestQueue: IRequestManager
Returns RequestManagerTandem
Methods
[asyncIterator]
Can be used to iterate over the
RequestManager
instance in afor await .. of
loop. Provides an alternative for the repeated use offetchNextRequest
.Returns AsyncGenerator<Request<Dictionary>, void, unknown>
addRequest
Parameters
requestLike: Source
optionaloptions: RequestQueueOperationOptions
Returns Promise<RequestQueueOperationInfo>
addRequestsBatched
Parameters
requests: RequestsLike
optionaloptions: AddRequestsBatchedOptions
Returns Promise<AddRequestsBatchedResult>
fetchNextRequest
getPendingCount
Get an offline approximation of the number of pending requests.
Returns number
getTotalCount
Get the total number of requests known to the request manager.
Returns number
handledCount
Returns number of handled requests.
Returns Promise<number>
isEmpty
Resolves to
true
if the next call to IRequestManager.fetchNextRequest function would returnnull
, otherwise it resolves tofalse
. Note that even if the provider is empty, there might be some pending requests currently being processed.Returns Promise<boolean>
isFinished
Returns
true
if all requests were already handled and there are no more left.Returns Promise<boolean>
markRequestHandled
Marks request as handled after successful processing.
Parameters
request: Request<Dictionary>
Returns Promise<null | void | RequestQueueOperationInfo>
reclaimRequest
Reclaims request to the provider if its processing failed. The request will become available in the next
fetchNextRequest()
.Parameters
request: Request<Dictionary>
optionaloptions: RequestQueueOperationOptions
Returns Promise<null | RequestQueueOperationInfo>
A request manager that combines a RequestList and a RequestQueue. It first reads requests from the RequestList and then, when needed, transfers them in batches to the RequestQueue.