incrementAndRead method

Future<(int, int)> incrementAndRead(
  1. String key,
  2. String other,
  3. Duration ttl
)

Adds one to key and also reads other with no change to it. Gives the new count of key and the count of other (0 when it is missing or older than its ttl). It is one message to the owner.

Implementation

Future<(int, int)> incrementAndRead(
  String key,
  String other,
  Duration ttl,
) async {
  List<int> counts = await _send(key, ttl.inMilliseconds, other);
  return (counts[0], counts[1]);
}