ReadPreference constructor
ReadPreference(})
Implementation
ReadPreference(this.mode,
{this.tags, this.maxStalenessSeconds, this.hedgeOptions}) {
if (mode == ReadPreferenceMode.primary) {
if (tags != null && tags!.isNotEmpty) {
throw ArgumentError(
'Primary read preference cannot be combined with tags');
}
if (maxStalenessSeconds != null) {
throw ArgumentError(
'Primary read preference cannot be combined with maxStalenessSeconds');
}
}
if (maxStalenessSeconds != null && maxStalenessSeconds! < 0) {
throw ArgumentError('maxStalenessSeconds must be a positive integer');
}
}