RequestExecutor typedef

RequestExecutor = Future Function(SerializableRequest request)

Callback that executes a SerializableRequest and returns the result.

Users must provide this when creating a PersistentQueueStore so the store knows how to replay persisted requests.

Example with Dio:

Future<dynamic> executor(SerializableRequest req) async {
  final response = await dio.request(
    req.url,
    options: Options(method: req.method, headers: req.headers),
    data: req.body,
  );
  return response.data;
}

Implementation

typedef RequestExecutor = Future<dynamic> Function(SerializableRequest request);