DVCountingCacheAdapter class abstract

Counting in the store rather than in a caller.

A caller that reads a number, adds one and writes it back loses every hit that lands between the read and the write, and the more instances there are the more it loses — which is exactly the case a shared counter exists for. A rate limit built on that is worse than none, because the deployment believes it has one.

So an adapter offers this only when the store itself can add: Redis INCRBY, a single process's own map. Anything else is honestly missing it, and callers refuse rather than pretending.

Constructors

DVCountingCacheAdapter()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

increment(String key, {int by, Duration? ttl}) → Future<int>
Adds by to the number at key and returns the new total, creating it at by when it is absent.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited