Skip to main content

RequestQueueClientAsync

Async sub-client for manipulating a single request queue.

Index

Methods

add_request

  • async add_request(request, *, forefront): dict

batch_add_requests

  • async batch_add_requests(requests, *, forefront, max_parallel, max_unprocessed_requests_retries, min_delay_between_unprocessed_requests_retries): BatchAddRequestsResult
  • Add requests to the request queue in batches.

    Requests are split into batches based on size and processed in parallel.

    https://docs.apify.com/api/v2#/reference/request-queues/batch-request-operations/add-requests


    Parameters

    • requests: list[dict]

      List of requests to be added to the queue.

    • optionalkeyword-onlyforefront: bool = False

      Whether to add requests to the front of the queue.

    • optionalkeyword-onlymax_parallel: int = 5

      Specifies the maximum number of parallel tasks for API calls. This is only applicable to the async client. For the sync client, this value must be set to 1, as parallel execution is not supported.

    • optionalkeyword-onlymax_unprocessed_requests_retries: int = 3

      Number of retry attempts for unprocessed requests.

    • optionalkeyword-onlymin_delay_between_unprocessed_requests_retries: timedelta = timedelta(milliseconds=500)

      Minimum delay between retry attempts for unprocessed requests.

    Returns BatchAddRequestsResult

batch_delete_requests

  • async batch_delete_requests(requests): dict

delete

  • async delete(): None

delete_request

  • async delete_request(request_id): None

delete_request_lock

  • async delete_request_lock(request_id, *, forefront): None

get

  • async get(): dict | None

get_request

  • async get_request(request_id): dict | None

list_and_lock_head

  • async list_and_lock_head(*, lock_secs, limit): dict

list_head

  • async list_head(*, limit): dict

list_requests

  • async list_requests(*, limit, exclusive_start_id): dict

prolong_request_lock

  • async prolong_request_lock(request_id, *, forefront, lock_secs): dict

update

  • async update(*, name): dict

update_request

  • async update_request(request, *, forefront): dict