getConnection method

Future<RedisCommand?> getConnection()

Returns the underlying Redis Command connection.

Ensures a connection is established before returning. Returns null if the connection could not be established.

Use this to call custom Redis commands via RedisCommand.send_object or other methods from the redis package.

Implementation

Future<RedisCommand?> getConnection() async {
  if (!await _connect()) {
    return null;
  }
  return _command;
}