Looks up a request in the cache, failing with the unit value if the
request is not in the cache, succeeding with Ref(None)
if the request is
in the cache but has not been executed yet, or Ref(Some(value))
if the
request has been executed.
Inserts a request and a Ref
that will contain the result of the request
when it is executed into the cache.
A
Cache
maintains an internal state with a mapping from requests toRef
s that will contain the result of those requests when they are executed. This is used internally by the library to provide deduplication and caching of requests.