lset method

  1. @override
Future<bool> lset(
  1. K key,
  2. int index,
  3. V value
)
override

LSET command (set value that placed in index)

Implementation

@override
Future<bool> lset(K key, int index, V value) async {
  final keyString = keyCodec.encode<K>(key);
  final valueString = valueCodec.encode<V>(value);
  _connection
      .sendCommand(Resp(['LSET', keyString, index.toString(), valueString]));
  final res = await _connection.receive();
  res.throwIfError();

  return res.stringValue == 'OK';
}