Skip to main content

BaseRequestQueueClient

Abstract base 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_request

  • Add a request to the queue.


    Parameters

    • request: Request

      The request to add to the queue

    • keyword-onlyforefront: bool = False

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

    Returns ProcessedRequest

    Request queue operation information.

batch_add_requests

  • Add a batch of requests to the queue.


    Parameters

    • requests: Sequence[Request]

      The requests to add to the queue

    • keyword-onlyforefront: bool = False

      Whether to add the requests to the head or the end of the queue

    Returns BatchRequestsOperationResponse

    Request queue batch operation information.

batch_delete_requests

delete

  • async delete(): None
  • Permanently delete the request queue managed by this client.


    Returns None

delete_request

  • async delete_request(request_id): None
  • Delete a request from the queue.


    Parameters

    • request_id: str

      ID of the request to delete.

    Returns None

delete_request_lock

  • async delete_request_lock(request_id, *, forefront): None
  • Delete the lock on a specific request in the queue.


    Parameters

    • request_id: str

      ID of the request to delete the lock

    • keyword-onlyforefront: bool = False

      Whether to put the request in the beginning or the end of the queue after the lock is deleted.

    Returns None

get

  • async get(): RequestQueueMetadata | None
  • Get metadata about the request queue being managed by this client.


    Returns RequestQueueMetadata | None

get_request

  • async get_request(request_id): Request | None
  • Retrieve a request from the queue.


    Parameters

    • request_id: str

      ID of the request to retrieve

    Returns Request | None

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

list_and_lock_head

  • Fetch and lock a specified number of requests from the start of the queue.

    Retrieves and locks the first few requests of a queue for the specified duration. This prevents the requests from being fetched by another client until the lock expires.


    Parameters

    • keyword-onlylock_secs: int

      Duration for which the requests are locked, in seconds.

    • keyword-onlylimit: int | None = None

      Maximum number of requests to retrieve and lock.

    Returns RequestQueueHeadWithLocks

    The desired number of locked requests from the beginning of the queue.

list_head

  • Retrieve a given number of requests from the beginning of the queue.


    Parameters

    • keyword-onlylimit: int | None = None

      How many requests to retrieve

    Returns RequestQueueHead

    The desired number of requests from the beginning of the queue.

prolong_request_lock

  • Prolong the lock on a specific request in the queue.


    Parameters

    • request_id: str

      The identifier of the request whose lock is to be prolonged.

    • keyword-onlyforefront: bool = False

      Whether to put the request in the beginning or the end of the queue after lock expires.

    • keyword-onlylock_secs: int

      The additional amount of time, in seconds, that the request will remain locked.

    Returns ProlongRequestLockResponse

update

  • Update the request queue metadata.


    Parameters

    • keyword-onlyname: str | None = None

      New new name for the request queue.

    Returns RequestQueueMetadata

    An object reflecting the updated request queue metadata.

update_request

  • Update a request in the queue.


    Parameters

    • request: Request

      The updated request

    • keyword-onlyforefront: bool = False

      Whether to put the updated request in the beginning or the end of the queue

    Returns ProcessedRequest

    The updated request