durable_queue_dio library
Dio integration for durable_queue.
- DioRetryRules: which Dio errors to retry, and
Retry-Afterdelays. - DurableQueueDioContext: cancel tokens and idempotency headers for a running task.
- HttpRequestTask and DurableQueueDio.registerHttpRequests: queue plain HTTP requests without writing a task class, optionally behind a network gate and with per-host rate limits (DurableQueueDio.addHttpHostRateLimit).
Classes
- DioRetryRules
- Decides which Dio errors are worth retrying, and how long to wait.
- HttpRequestTask
- A stored HTTP request: method, URL, headers, query, and a JSON or text body.
Extensions
- DurableQueueDio on DurableQueue
- Registers HttpRequestTask on a queue.
- DurableQueueDioContext on TaskContext
- Dio helpers for a running task.
Constants
- defaultHostRateLimit → const String
-
Name of the per-host rate limit added by
DurableQueueDio.addHttpHostRateLimitunless another is given. - defaultIdempotencyHeader → const String
- Default header for DurableQueueDioContext.withIdempotencyKey.
Functions
-
parseRetryAfter(
String? value, {DateTime? now}) → Duration? -
Parses an HTTP
Retry-Afterheader value.
Typedefs
-
HttpResponseCallback
= FutureOr<
void> Function(HttpRequestTask task, Response<Object?> response, TaskContext context) - Called after a stored request succeeds.