durable_queue_dio 0.2.1
durable_queue_dio: ^0.2.1 copied to clipboard
Dio integration for durable_queue. Retry rules for HTTP errors, Retry-After, idempotency headers, cancellation, and queued HTTP requests.
0.2.1 #
- When a request gets a 429 or 503 with a
Retry-Afterheader and a per-host limit exists (addHttpHostRateLimit), the host's bucket is held for that time, so every queued request to the host waits.registerHttpRequeststakeshostRateLimit(default'http-host',nullto turn it off). HttpRequestTask.hostOfUrl(url, baseUrl:).defaultHostRateLimitconstant.- Requires
durable_queue0.5.3 or later.
0.2.0 #
registerHttpRequeststakesrequires,deferOn, andrateLimitand passes them toDurableQueue.register, so queued requests can wait for a network gate and be rate limited.DioRetryRules.deferOn(gate): aregister(deferOn:)rule that turns connection errors (connectionError,connectionTimeout) into a wait for the gate instead of a failed attempt.DioRetryRules.isConnectionErrorexposes the same check.queue.addHttpHostRateLimit(limit, dio:): a rate limit per API host for queued requests. Relative URLs are resolved against the DiobaseUrl.HttpRequestTask.hostOf(task, baseUrl:): the host a stored request goes to.- Requires
durable_queue0.5.0 or later (>=0.5.0 <0.6.0).
0.1.1 #
- Allow
durable_queue0.5.x (>=0.4.0 <0.6.0). No code change.
0.1.0 #
- Initial release.
DioRetryRules: retries timeouts, connection failures, and HTTP 408, 425, 429, 500, 502, 503, 504 by default; honorsRetry-After(seconds or HTTP-date) up to a configurable maximum. Userules.shouldRetryasretryIfandrules.retryDelayasretryDelay.parseRetryAfterforRetry-Afterheader values. Two-digit years in RFC 850 dates follow the RFC 9110 50-year rule with everyhttp_parser4.x.TaskContexthelpers:dioCancelToken()aborts the request when the task is cancelled;withIdempotencyKey()sends the task's idempotency key as a header (defaultIdempotency-Key).HttpRequestTaskandqueue.registerHttpRequests(dio): queue HTTP requests (method, URL, headers, query, JSON or text body) without writing a task class, with an optionalonResponsecallback.- Requires
durable_queue0.4.0 anddio5.11.1 or later.