Add retries/parallelism/byte-chunking to batch_add_requests; type request-queue results - #21
Merged
Merged
Conversation
…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.
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while auditing the client for improvement opportunities against the OpenAPI spec and the reference
apify-client-jsclient.What changed
RequestQueueClient::batch_add_requestsbrought to parity with the reference client'sbatchAddRequests:unprocessed(rate-limited) with exponential backoffserde_json::Valuerequest-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_requestsbatch_delete_requestsnow also rejects more than 25 requests client-side instead of forwarding an oversized payloadCompatibility
0.7.0→0.8.0; seeCHANGELOG.mdfor the full list