consumer method
A consumer: one destination's position in the log.
tenant delivers only that tenant's changes, filtered here at the
source; a change with no tenant never reaches a tenant destination.
Implementation
DVCaptureConsumer consumer(
String name, {
required DVCaptureSink sink,
String? tenant,
Set<String>? models,
int batchSize = 500,
Duration? lagThreshold,
}) {
if (name.trim().isEmpty) {
throw ArgumentError.value(name, 'name', 'must not be empty');
}
if (batchSize < 1) {
throw ArgumentError.value(batchSize, 'batchSize', 'must be at least 1');
}
final DVCaptureConsumer created = DVCaptureConsumer._(
this,
name,
sink: sink,
tenant: tenant,
models: models == null ? null : Set<String>.unmodifiable(models),
batchSize: batchSize,
lagThreshold: lagThreshold,
);
_consumers[name] = created;
return created;
}