start method

Future<void> start({
  1. bool handleError(
    1. Exception e
    )?,
  2. Duration? connectTimeout,
})

Starts the controller and connects to Redis. Maintains an open connection until stop is called.

If connectTimeout is set, it overrides RedisController.connectTimeout for the TCP/TLS connections opened during this start call only.

Implementation

Future<void> start({
  bool Function(Exception e)? handleError,
  Duration? connectTimeout,
}) async {
  final connected = await _connect(handleError, connectTimeout);
  if (!connected && handleError != null) {
    return;
  }
  await _connectPubSub(connectTimeout);

  unawaited(_keepAlive());
}