close method

Future close()

Implementation

Future close() async {
  while (sendQueue.isNotEmpty) {
    masterConnection?._sendBuffer();
  }
  sendQueue.clear();

  _masterConnection == null;

  for (var hostUrl in _connectionPool.keys) {
    var connection = _connectionPool[hostUrl];
    _log.fine(() => '$db: ${connection?.serverConfig.hostUrl} closed');
    await connection?.close();
  }
  replyCompleters.clear();
}