pub struct RequestQueueClient { /* private fields */ }Expand description
Client for a specific request queue.
Implementations§
Source§impl RequestQueueClient
impl RequestQueueClient
Sourcepub fn with_client_key(self, client_key: impl Into<String>) -> Self
pub fn with_client_key(self, client_key: impl Into<String>) -> Self
Sets the clientKey used to identify this client across requests (for locking).
Sourcepub async fn get(&self) -> ApifyClientResult<Option<RequestQueue>>
pub async fn get(&self) -> ApifyClientResult<Option<RequestQueue>>
Fetches the queue metadata, or None if it does not exist.
Sourcepub async fn update<T: Serialize>(
&self,
new_fields: &T,
) -> ApifyClientResult<RequestQueue>
pub async fn update<T: Serialize>( &self, new_fields: &T, ) -> ApifyClientResult<RequestQueue>
Updates the queue metadata (e.g. name, title).
Sourcepub async fn delete(&self) -> ApifyClientResult<()>
pub async fn delete(&self) -> ApifyClientResult<()>
Deletes the queue.
Sourcepub async fn list_head(
&self,
limit: Option<i64>,
) -> ApifyClientResult<RequestQueueHead>
pub async fn list_head( &self, limit: Option<i64>, ) -> ApifyClientResult<RequestQueueHead>
Lists requests from the head of the queue (without locking them).
Sourcepub async fn add_request(
&self,
request: &RequestQueueRequest,
forefront: bool,
) -> ApifyClientResult<RequestQueueOperationInfo>
pub async fn add_request( &self, request: &RequestQueueRequest, forefront: bool, ) -> ApifyClientResult<RequestQueueOperationInfo>
Adds a single request to the queue. If forefront is true, adds it to the front.
Sourcepub async fn get_request(
&self,
id: &str,
) -> ApifyClientResult<Option<RequestQueueRequest>>
pub async fn get_request( &self, id: &str, ) -> ApifyClientResult<Option<RequestQueueRequest>>
Gets a request by ID, or None if it does not exist.
Sourcepub async fn update_request(
&self,
request: &RequestQueueRequest,
forefront: bool,
) -> ApifyClientResult<RequestQueueOperationInfo>
pub async fn update_request( &self, request: &RequestQueueRequest, forefront: bool, ) -> ApifyClientResult<RequestQueueOperationInfo>
Updates a request (which must include its id).
Sourcepub async fn delete_request(&self, id: &str) -> ApifyClientResult<()>
pub async fn delete_request(&self, id: &str) -> ApifyClientResult<()>
Deletes a request by ID.
Sourcepub async fn list_and_lock_head(
&self,
lock_secs: i64,
limit: Option<i64>,
) -> ApifyClientResult<Value>
pub async fn list_and_lock_head( &self, lock_secs: i64, limit: Option<i64>, ) -> ApifyClientResult<Value>
Lists and locks requests from the head of the queue for lock_secs seconds.
Sourcepub async fn batch_add_requests(
&self,
requests: &[RequestQueueRequest],
forefront: bool,
) -> ApifyClientResult<Value>
pub async fn batch_add_requests( &self, requests: &[RequestQueueRequest], forefront: bool, ) -> ApifyClientResult<Value>
Adds multiple requests to the queue, automatically splitting the input into chunks of
at most [MAX_REQUESTS_PER_BATCH_OPERATION] requests per API call (the API rejects
larger batches). The per-chunk responses are merged into a single result whose
processedRequests / unprocessedRequests arrays concatenate every chunk’s, matching
the reference client’s client-side chunking.
Sourcepub async fn batch_delete_requests<T: Serialize>(
&self,
requests: &[T],
) -> ApifyClientResult<Value>
pub async fn batch_delete_requests<T: Serialize>( &self, requests: &[T], ) -> ApifyClientResult<Value>
Deletes multiple requests in a single batch operation.
Sourcepub async fn list_requests(
&self,
options: ListRequestsOptions,
) -> ApifyClientResult<Value>
pub async fn list_requests( &self, options: ListRequestsOptions, ) -> ApifyClientResult<Value>
Lists requests in the queue.
Supports pagination via limit/exclusive_start_id and the spec’s cursor/filter
parameters (see ListRequestsOptions).
Sourcepub async fn prolong_request_lock(
&self,
id: &str,
lock_secs: i64,
forefront: bool,
) -> ApifyClientResult<Value>
pub async fn prolong_request_lock( &self, id: &str, lock_secs: i64, forefront: bool, ) -> ApifyClientResult<Value>
Prolongs the lock on a request for another lock_secs seconds.
If forefront is true, the request moves to the front of the queue when its lock
later expires.
Sourcepub async fn delete_request_lock(
&self,
id: &str,
forefront: bool,
) -> ApifyClientResult<()>
pub async fn delete_request_lock( &self, id: &str, forefront: bool, ) -> ApifyClientResult<()>
Releases the lock on a request so other clients can process it.
If forefront is true, the request moves to the front of the queue.
Sourcepub fn paginate_requests(
&self,
page_limit: Option<i64>,
) -> RequestQueueRequestsIterator
pub fn paginate_requests( &self, page_limit: Option<i64>, ) -> RequestQueueRequestsIterator
Lazily paginates over all requests in the queue, fetching pages on demand.
Returns a RequestQueueRequestsIterator; call its next() to get one request at a
time. Pagination uses the API’s opaque nextCursor token: the first page may be
anchored with exclusiveStartId, but every subsequent page is fetched with cursor
(matching the JS reference). cursor and exclusiveStartId are mutually exclusive.
Sourcepub async fn unlock_requests(&self) -> ApifyClientResult<Value>
pub async fn unlock_requests(&self) -> ApifyClientResult<Value>
Unlocks all requests currently locked by this client (identified by client_key).
Trait Implementations§
Source§impl Clone for RequestQueueClient
impl Clone for RequestQueueClient
Source§fn clone(&self) -> RequestQueueClient
fn clone(&self) -> RequestQueueClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more