Skip to main content

RequestQueueClient

Struct RequestQueueClient 

Source
pub struct RequestQueueClient { /* private fields */ }
Expand description

Client for a specific request queue.

Implementations§

Source§

impl RequestQueueClient

Source

pub fn with_client_key(self, client_key: impl Into<String>) -> Self

Sets the clientKey used to identify this client across requests (for locking).

Source

pub async fn get(&self) -> ApifyClientResult<Option<RequestQueue>>

Fetches the queue metadata, or None if it does not exist.

Source

pub async fn update<T: Serialize>( &self, new_fields: &T, ) -> ApifyClientResult<RequestQueue>

Updates the queue metadata (e.g. name, title).

Source

pub async fn delete(&self) -> ApifyClientResult<()>

Deletes the queue.

Source

pub async fn list_head( &self, limit: Option<i64>, ) -> ApifyClientResult<RequestQueueHead>

Lists requests from the head of the queue (without locking them).

Source

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.

Source

pub async fn get_request( &self, id: &str, ) -> ApifyClientResult<Option<RequestQueueRequest>>

Gets a request by ID, or None if it does not exist.

Source

pub async fn update_request( &self, request: &RequestQueueRequest, forefront: bool, ) -> ApifyClientResult<RequestQueueOperationInfo>

Updates a request (which must include its id).

Source

pub async fn delete_request(&self, id: &str) -> ApifyClientResult<()>

Deletes a request by ID.

Source

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.

Source

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.

Source

pub async fn batch_delete_requests<T: Serialize>( &self, requests: &[T], ) -> ApifyClientResult<Value>

Deletes multiple requests in a single batch operation.

Source

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).

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> RequestQueueClient

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RequestQueueClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more