start static method

Future<bool> start({
  1. DVQueues queues = const DVQueues(),
})

Makes the log's collections and registers delivery and backfill on queues, in every process that configured capture: the one that dispatches and the worker that runs them both need the codecs.

Returns false, doing nothing, where capture is not configured.

Implementation

static Future<bool> start({DVQueues queues = const DVQueues()}) async {
  final _Runtime? runtime = _runtime;
  if (runtime == null) return false;
  await runtime.log.ensureSchema();
  runtime.log.registerJobs(queues);
  runtime.queues = queues;
  // A change published here is sent on now rather than at the next tick.
  runtime.log.onPublished = (int _) => unawaited(_dispatchDeliveries());
  return true;
}