class

JoobQ::CachedFlag

Inherits Reference < Object

A boolean read from a remote source, refreshed at most once per ttl. A failing load keeps the last known value, so a source outage never propagates into the callers' hot paths, and a local set always wins over a load that was already in flight.

Constants

Log = ::Log.for("CACHED_FLAG")

Constructors

new(ttl : Time::Span, &load : -> Bool)
Source

Instance methods

set(value : Bool) : Nil

Applies a change made by this process immediately.

Source