set method
Sets a String in the Redis cache, which optionally expires.
Implementation
Future<bool> set(String key, String message, {Duration? lifetime}) async {
await _connect();
try {
var object = ['SET', key, message];
if (lifetime != null) {
object.addAll(['PX', '${lifetime.inMilliseconds}']);
}
var result = await _command?.send_object(object);
return result == 'OK';
} catch (e) {
_invalidateCommand();
return false;
}
}