startProcess method
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,
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 {
// validateConfig should not be necessary, because we are already using a typed class
// final foundErrors = validateConfig(config);
// if (foundErrors.length > 0) {
// throw Exception("invalid config: ${foundErrors}");
// }
final satelliteClientOpts = SatelliteClientOpts(
host: config.replication.host,
port: config.replication.port,
ssl: config.replication.ssl,
timeout: config.replication.timeout.inMilliseconds,
dialect: config.replication.dialect,
);
final client = SatelliteClient(
dbDescription: dbDescription,
socketFactory: socketFactory,
opts: satelliteClientOpts,
);
final SatelliteOpts satelliteOpts =
satelliteDefaults(config.namespace).copyWith(
connectionBackoffOptions: config.connectionBackoffOptions,
);
final satellite = SatelliteProcess(
dbName: dbName,
adapter: adapter,
migrator: migrator,
notifier: notifier,
client: client,
opts: satelliteOpts,
);
await satellite.start(config.auth);
return satellite;
}