GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Crawlee for Python
  • Docs
  • API
  • Changelog
  • Blog
  • Next
  • 0.6
  • Autoscaling
  • Browser management
  • Configuration
  • Crawlers
  • Crawling contexts
  • Errors
  • Event data

This view

  • Original page
  • New address

GeezerVison is showing crawlee.dev — RequestQueueClient | API | Crawlee for Python · Fast, reliable Python web crawlers.

Version: 1.11

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

  • RequestQueueClient
    • FileSystemRequestQueueClient
    • MemoryRequestQueueClient
    • RedisRequestQueueClient
    • SqlRequestQueueClient

Index

Methods

  • add_batch_of_requests
  • drop
  • fetch_next_request
  • get_metadata
  • get_request
  • is_empty
  • is_finished
  • mark_request_as_handled
  • purge
  • reclaim_request

Methods

add_batch_of_requests

  • async add_batch_of_requests(requests, *, forefront): AddRequestsResponse
  • Overrides 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.


    Parameters

    • requests: Sequence[Request]

      The collection of requests to add to the queue.

    • optionalkeyword-onlyforefront: bool = False

      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.

    Returns AddRequestsResponse

    A response object containing information about which requests were successfully processed and which failed (if any).

drop

  • async drop(): None
  • Overrides RequestQueueClient.drop

    Drop the whole request queue and remove all its values.

    The backend method for the RequestQueue.drop call.


    Returns None

fetch_next_request

  • async fetch_next_request(): Request | None
  • 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.


    Returns Request | None

    The request or None if there are no more pending requests.

get_metadata

  • async get_metadata(): RequestQueueMetadata
  • Overrides RequestQueueClient.get_metadata

    Get the metadata of the request queue.


    Returns RequestQueueMetadata

get_request

  • async get_request(unique_key): Request | None
  • Overrides RequestQueueClient.get_request

    Retrieve a request from the queue.


    Parameters

    • unique_key: str

      Unique key of the request to retrieve.

    Returns Request | None

    The retrieved request, or None, if it did not exist.

is_empty

  • async is_empty(): bool
  • Overrides RequestQueueClient.is_empty

    Check if the request queue is empty. That means there are no requests available to fetch.


    Returns bool

    True if the request queue is empty, False otherwise.

is_finished

  • async is_finished(): bool
  • Overrides RequestQueueClient.is_finished

    Check if the request queue is finished.

    A finished queue is empty and has no requests currently being processed.

    Warning

    This default only checks is_empty, which reports whether requests are available to fetch, not whether requests are still being processed. It can therefore return True while requests are in progress. Subclasses that track in-progress requests should override this method; all built-in clients already do.


    Returns bool

    True if the request queue is finished, False otherwise.

mark_request_as_handled

  • async mark_request_as_handled(request): ProcessedRequest | None
  • Overrides RequestQueueClient.mark_request_as_handled

    Mark a request as handled after successful processing.

    Handled requests will never again be returned by the RequestQueue.fetch_next_request method.


    Parameters

    • request: Request

      The request to mark as handled.

    Returns ProcessedRequest | None

    Information about the queue operation. None if the given request was not in progress.

purge

  • async purge(): None
  • Overrides RequestQueueClient.purge

    Purge all items from the request queue.

    The backend method for the RequestQueue.purge call.


    Returns None

reclaim_request

  • async reclaim_request(request, *, forefront): ProcessedRequest | None
  • 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.


    Parameters

    • request: Request

      The request to return to the queue.

    • optionalkeyword-onlyforefront: bool = False

      Whether to add the request to the head or the end of the queue.

    Returns ProcessedRequest | None

    Information about the queue operation. None if the given request was not in progress.

Page Options
Hide Inherited
  • add_batch_of_requests
  • drop
  • fetch_next_request
  • get_metadata
  • get_request
  • is_empty
  • is_finished
  • mark_request_as_handled
  • purge
  • reclaim_request
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.