put method
Stores an item in the cache for a given duration.
Implementation
@override
Future<void> put(String key, dynamic value, {Duration? ttl}) async {
final cmd = await _getCommand();
final encoded = jsonEncode(value);
if (ttl != null) {
await cmd.send_object(['SETEX', key, ttl.inSeconds, encoded]);
} else {
await cmd.set(key, encoded);
}
}