getSecondaryConnection method

Connection? getSecondaryConnection()

Implementation

Connection? getSecondaryConnection() {
  final secondaries = _connectionPool.values
      .where((c) => !c.isMaster && c.connected)
      .toList()
    ..shuffle();
  if (secondaries.isEmpty) {
    return null;
  }
  return secondaries.first;
}