freshnessBand

fun freshnessBand(now: Instant, lastSyncedAt: Instant?, ttl: Duration, lastError: Throwable? = null): FreshnessBand

Pure staleness computation. First match wins:

  1. lastError != nullFreshnessBand.VeryStale

  2. lastSyncedAt == nullFreshnessBand.Initial

  3. age <= ttlFreshnessBand.Fresh

  4. age <= 3·ttlFreshnessBand.Stale

  5. else → FreshnessBand.VeryStale