startProcess method

  1. @override
Future<Satellite> startProcess({
  1. required DbName dbName,
  2. required DBSchema dbDescription,
  3. required DatabaseAdapter adapter,
  4. required Migrator migrator,
  5. required Notifier notifier,
  6. required SocketFactory socketFactory,
  7. required HydratedConfig config,
  8. SatelliteOverrides? overrides,
})

Implementation

@override
Future<Satellite> startProcess({
  required DbName dbName,
  required DBSchema dbDescription,
  required DatabaseAdapter adapter,
  required Migrator migrator,
  required Notifier notifier,
  required SocketFactory socketFactory,
  required HydratedConfig config,
  SatelliteOverrides? overrides,
}) async {
  if (_shouldFailToStart) {
    throw Exception('Failed to start satellite process');
  }

  final String namespace = migrator.queryBuilder.defaultNamespace;
  var effectiveOpts = satelliteDefaults(namespace);
  if (overrides != null) {
    effectiveOpts = effectiveOpts.copyWithOverrides(overrides);
  }

  if (satellites[dbName] != null) {
    return satellites[dbName]!;
  }

  final satellite = MockSatelliteProcess(
    dbName: dbName,
    adapter: adapter,
    migrator: migrator,
    notifier: notifier,
    socketFactory: socketFactory,
    opts: effectiveOpts,
  );
  satellites[dbName] = satellite;
  await satellite.start(const AuthConfig());
  return satellite;
}