The FetchQueue class is a utility class that allows for managing and controlling concurrent fetch requests.
It ensures that the number of active requests does not exceed a specified limit, and queues any additional requests until a slot becomes available.
Kind: global class
Initializes a new instance of the FetchQueue class with an optional FetchQueueConfig object. If no options are provided, the default concurrent value is set to 3.
| Param | Type | Description |
|---|---|---|
| options | FetchQueueConfig |
The FetchQueueConfig object containing the concurrent value. |
Returns the custom fetch function used by the FetchQueue class to handle queuing of fetch requests.
Kind: instance method of FetchQueue
Returns:
The custom fetch function.
Kind: instance method of FetchQueue
Returns:
value of concurrent property
set value of concurrent property
Kind: instance method of FetchQueue
| Param | Type |
|---|---|
| concurrent | number |
Kind: instance method of FetchQueue
Returns:
value of debug property
set value of debug property
Kind: instance method of FetchQueue
| Param | Type |
|---|---|
| debug | boolean |
Empties the queue of fetch requests.
Kind: instance method of FetchQueue
| Param | Description |
|---|---|
| urlPattern | Optional regular expression to match against the URLs in the queue. If provided, only the requests with URLs that match the pattern will be aborted. If not provided, all requests in the queue will be aborted. |
Disables the queuing of fetch requests in the FetchQueue.
Kind: instance method of FetchQueue
Enables the queuing of fetch requests in the FetchQueue.
Kind: instance method of FetchQueue
Kind: instance method of FetchQueue
Returns:
Length of queue
Kind: instance method of FetchQueue
Returns:
Number of active requests