AsyncNativeOdbcConnection constructor

AsyncNativeOdbcConnection({
  1. Duration? requestTimeout,
  2. void isolateEntry(
    1. SendPort
    )?,
  3. bool autoRecoverOnWorkerCrash = false,
  4. int workerCount = 1,
  5. int? maxPendingRequests,
  6. AsyncBackpressureMode backpressureMode = AsyncBackpressureMode.failFast,
  7. Duration? backpressureTimeout,
})

Implementation

AsyncNativeOdbcConnection({
  Duration? requestTimeout,
  void Function(SendPort)? isolateEntry,
  this.autoRecoverOnWorkerCrash = false,
  this.workerCount = 1,
  this.maxPendingRequests,
  this.backpressureMode = AsyncBackpressureMode.failFast,
  this.backpressureTimeout,
})  : _requestTimeout = requestTimeout,
      _isolateEntry = isolateEntry {
  if (workerCount < 1) {
    throw ArgumentError.value(
      workerCount,
      'workerCount',
      'must be greater than or equal to 1',
    );
  }
  final pendingLimit = maxPendingRequests;
  if (pendingLimit != null && pendingLimit < 1) {
    throw ArgumentError.value(
      pendingLimit,
      'maxPendingRequests',
      'must be null or greater than or equal to 1',
    );
  }
  final pendingTimeout = backpressureTimeout;
  if (pendingTimeout != null && pendingTimeout < Duration.zero) {
    throw ArgumentError.value(
      pendingTimeout,
      'backpressureTimeout',
      'must be null, zero, or greater than zero',
    );
  }
}