ping method

  1. @override
Future<String> ping([
  1. String? message
])
override

PINGs the server.

Returns 'PONG' if no message is provided, otherwise returns the message. Throws a ValkeyServerException if an error occurs.

Implementation

@override
Future<String> ping([String? message]) async {
  final command = (message == null) ? ['PING'] : ['PING', message];
  // PING response can be Simple String or Bulk String
  final response = await execute(command);
  // Our simple parser will return "PONG" or the message.
  return response as String;
}