set method

void set(
  1. K key,
  2. V value
)

Stores value under key with a fresh expiry ttl from now.

Implementation

void set(K key, V value) {
  _map[key] = (value, DateTime.now().add(_ttl));
}