Skip to content

Add retries/parallelism/byte-chunking to batch_add_requests; type request-queue results - #21

Merged
Pijukatel merged 2 commits into
masterfrom
claude/rq-batch-add-retries
Aug 12, 2026
Merged

Add retries/parallelism/byte-chunking to batch_add_requests; type request-queue results#21
Pijukatel merged 2 commits into
masterfrom
claude/rq-batch-add-retries

Conversation

@Pijukatel

@Pijukatel Pijukatel commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Found while auditing the client for improvement opportunities against the OpenAPI spec and the reference apify-client-js client.

What changed

  • RequestQueueClient::batch_add_requests brought to parity with the reference client's batchAddRequests:
    • splits large inputs by both request count (25) and JSON byte size (~9 MiB)
    • sends chunks with bounded parallelism
    • retries requests reported unprocessed (rate-limited) with exponential backoff
    • replaces the previous naive count-only chunker that had no retry logic
  • Typed the remaining raw serde_json::Value request-queue methods against the schemas the OpenAPI spec already documents, matching every other resource client in the crate:
    • list_and_lock_head, list_requests, unlock_requests, prolong_request_lock, batch_delete_requests
    • batch_delete_requests now also rejects more than 25 requests client-side instead of forwarding an oversized payload

Compatibility

  • Breaking change (return-type and signature changes on the methods above)
  • Version bumped 0.7.00.8.0; see CHANGELOG.md for the full list

…e request-queue lock/list/batch results

RequestQueueClient::batch_add_requests now matches the reference client's
batchAddRequests: chunks by both request count (25) and JSON byte size
(~9 MiB), sends chunks with bounded parallelism (default 5 in flight), and
retries requests reported unprocessed (rate-limited) with exponential
backoff (default 3 retries). Its second parameter is now
BatchAddRequestsOptions instead of a bare forefront: bool.

list_and_lock_head, list_requests, unlock_requests, prolong_request_lock
and batch_delete_requests now return typed models (LockedRequestQueueHead,
RequestQueueRequestsPage, UnlockRequestsResult, RequestLockInfo,
BatchRequestsOperationResult) instead of serde_json::Value, matching every
other resource client and the stable schemas the OpenAPI spec already
documents for these endpoints. batch_delete_requests also now rejects more
than 25 requests client-side instead of forwarding an oversized payload to
the API.

Breaking change, bumping 0.7.0 -> 0.8.0.
@github-actions github-actions Bot added this to the 147th sprint - Tooling team milestone Aug 11, 2026
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Aug 11, 2026
- Correct dedup_key's doc comment: the API's keyless fallback dedups by
  the raw url, not a "normalized" one.
- batch_add_requests now rejects an empty requests slice with
  InvalidArgument, matching batch_delete_requests and the reference
  client (both validate non-empty input).
- Use the imported UnprocessedRequest name instead of the fully-qualified
  crate::models:: path in the retry loop's fail-safe return.
- Replace a vacuous assert!(limit >= 0) in the lock-lifecycle test with a
  real invariant: filtering on both locked+pending must match the
  unfiltered listing.
@Pijukatel
Pijukatel merged commit c140be8 into master Aug 12, 2026
2 checks passed
@Pijukatel
Pijukatel deleted the claude/rq-batch-add-retries branch August 12, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants