An abstract class for request queue resource clients.
These clients are specific to the type of resource they manage and operate under a designated storage client, like a memory storage client.
Hierarchy Index Methods add_batch_of_requestsOverrides RequestQueueClient.add_batch_of_requests
Add batch of requests to the queue.
This method adds a batch of requests to the queue. Each request is processed based on its uniqueness (determined by unique_key
). Duplicates will be identified but not re-added to the queue.
The collection of requests to add to the queue.
Whether to put the added requests at the beginning (True) or the end (False) of the queue. When True, the requests will be processed sooner than previously added requests.
Overrides RequestQueueClient.drop
Drop the whole request queue and remove all its values.
The backend method for the RequestQueue.drop
call.
Overrides RequestQueueClient.fetch_next_request
Return the next request in the queue to be processed.
Once you successfully finish processing of the request, you need to call RequestQueue.mark_request_as_handled
to mark the request as handled in the queue. If there was some error in processing the request, call RequestQueue.reclaim_request
instead, so that the queue will give the request to some other consumer in another call to the fetch_next_request
method.
Note that the None
return value does not mean the queue processing finished, it means there are currently no pending requests. To check whether all requests in queue were finished, use RequestQueue.is_finished
instead.
Overrides RequestQueueClient.purge
Purge all items from the request queue.
The backend method for the RequestQueue.purge
call.
Overrides RequestQueueClient.reclaim_request
Reclaim a failed request back to the queue.
The request will be returned for processing later again by another call to RequestQueue.fetch_next_request
.
The request to return to the queue.
Whether to add the request to the head or the end of the queue.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4