cats.effect.kernel.Ref
See theRef companion object
A thread-safe, concurrent mutable reference.
Provides safe concurrent access and modification of its content, but no functionality for
synchronisation, which is instead handled by Deferred. For this reason, a Ref
is always
initialised to a value.
The default implementation is nonblocking and lightweight, consisting essentially of a purely
functional wrapper over an AtomicReference
. Consequently it ''must not'' be used to store
mutable data as AtomicReference#compareAndSet
and friends are dependent upon object
reference equality.