PersistentSubscriptionSettings constructor

PersistentSubscriptionSettings({
  1. Position? startFrom,
  2. int readBatchSize = 20,
  3. int maxRetryCount = 10,
  4. int liveBufferSize = 500,
  5. bool resolveLinkTos = false,
  6. bool extraStatistics = false,
  7. int maxSubscriberCount = 0,
  8. int historyBufferSize = 500,
  9. int minCheckPointCount = 10,
  10. int maxCheckPointCount = 1000,
  11. Duration checkPointAfter = const Duration(seconds: 2),
  12. Duration messageTimeout = const Duration(seconds: 30),
  13. SystemConsumerStrategies consumerStrategy = SystemConsumerStrategies.roundRobin,
})

Construct a new PersistentSubscriptionSettings instance

Implementation

PersistentSubscriptionSettings({
  this.startFrom,
  this.readBatchSize = 20,
  this.maxRetryCount = 10,
  this.liveBufferSize = 500,
  this.resolveLinkTos = false,
  this.extraStatistics = false,
  this.maxSubscriberCount = 0,
  this.historyBufferSize = 500,
  this.minCheckPointCount = 10,
  this.maxCheckPointCount = 1000,
  this.checkPointAfter = const Duration(seconds: 2),
  this.messageTimeout = const Duration(seconds: 30),
  this.consumerStrategy = SystemConsumerStrategies.roundRobin,
}) {
  if (messageTimeout < Duration.zero || messageTimeout.inMilliseconds > Max) {
    throw ArgumentError.value(
      messageTimeout,
      'messageTimeout',
      'must be greater than 0 and less than or equal to $Max',
    );
  }

  if (checkPointAfter < Duration.zero ||
      checkPointAfter.inMilliseconds > Max) {
    throw ArgumentError.value(
      checkPointAfter,
      'checkPointAfter',
      'must be greater than 0 and less than or equal to $Max',
    );
  }
}