Removes a queue item from the queue. Returns true if a queue item was removed and false if not. Use of this function is likely not needed as items are auto-dequeued when their turn is reached.
.enqueue(url[, data, options])
Adds a URL to the queue. Returns a queue item ID on success.
This option is not available in the browser version (due to extreme file size).
options.maxSockets
Type: Number
Default value: Infinity
The maximum number of connections allowed at any given time. A value of 0 will prevent anything from going out. A value of Infinity will provide no concurrency limiting.
options.maxSocketsPerHost
Type: Number
Default value: 2
The maximum number of connections per host allowed at any given time. A value of 0 will prevent anything from going out. A value of Infinity will provide no per-host concurrency limiting.
options.rateLimit
Type: Number
Default value: 0
The number of milliseconds to wait before each request. For a typical rate limiter, also set maxSockets to 1.
Events
END_EVENT, 'end'
Called when the last item in the queue has been completed/dequeued.
ITEM_EVENT, 'item'
Called when a queue item's turn has been reached. Arguments are: url, data, done. Call the done function when your item's operations are complete.