RestOfflineQueueClient constructor

RestOfflineQueueClient(
  1. Client _inner,
  2. RequestSqliteCacheManager<Request> requestManager, {
  3. void onReattempt(
    1. Request request,
    2. int statusCode
    )?,
  4. void onRequestException(
    1. Request request,
    2. Object error
    )?,
  5. List<int>? reattemptForStatusCodes,
  6. Set<String>? ignorePaths,
})

Implementation

RestOfflineQueueClient(
  this._inner,
  this.requestManager, {
  this.onReattempt,
  this.onRequestException,
  List<int>? reattemptForStatusCodes,

  /// Any request URI that begins with one of these paths will not be
  /// handled by the offline queue and will be forwarded to [_inner].
  ///
  /// For example, if an ignore path is `/v1/ignored-path`, a request
  /// to `http://0.0.0.0:3000/v1/ignored-path/endpoint` will not be
  /// cached and retried on failure.
  Set<String>? ignorePaths,
})  : _logger = Logger('OfflineQueueHttpClient#${requestManager.databaseName}'),
      reattemptForStatusCodes = reattemptForStatusCodes ?? [404, 501, 502, 503, 504],
      _ignorePattern = ignorePaths == null ? null : RegExp(ignorePaths.join('|'));