store method

  1. @override
Future store(
  1. String? correlationId,
  2. String key,
  3. dynamic value,
  4. int timeout,
)

Stores value in the cache with expiration time.

  • correlationId (optional) transaction id to trace execution through call chain.
  • key a unique value key.
  • value a value to store.
  • timeout expiration timeout in milliseconds. Return Future that receives an 'OK' for success Throws error

Implementation

@override
Future<dynamic> store(
    String? correlationId, String key, value, int timeout) async {
  if (!_checkOpened(correlationId)) return;
  return await _client!.send_object(['SET', key, value, 'PX', timeout]);
}