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.
Looks up a request in the cache.
Looks up a request in the cache. If the request is not in the cache
returns a Left with a Ref that can be set with a Some to complete
the request. If the request is in the cache returns a Right with a Ref
that either contains Some with a result if the request has been executed
or None if the request has not been executed yet.
Inserts a request and a Ref that will contain the result of the request
when it is executed into the cache.
A
Cachemaintains an internal state with a mapping from requests toRefs 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.