Safe Haskell | None |
---|
Generic fetching infrastructure, used by Monad
.
- data CacheResult a
- = Uncached (ResultVar a)
- | CachedNotFetched (ResultVar a)
- | Cached (Either SomeException a)
- cached :: Request r a => Env u -> r a -> IO (CacheResult a)
- memoized :: Request r a => Env u -> r a -> IO (CacheResult a)
- performFetches :: forall u. Env u -> RequestStore u -> IO ()
Documentation
data CacheResult a Source
Possible responses when checking the cache.
Uncached (ResultVar a) | The request hadn't been seen until now. |
CachedNotFetched (ResultVar a) | The request has been seen before, but its result has not yet been fetched. |
Cached (Either SomeException a) | The request has been seen before, and its result has already been fetched. |
cached :: Request r a => Env u -> r a -> IO (CacheResult a)Source
Checks the data cache for the result of a request.
memoized :: Request r a => Env u -> r a -> IO (CacheResult a)Source
Checks the memo cache for the result of a computation.
performFetches :: forall u. Env u -> RequestStore u -> IO ()Source
Issues a batch of fetches in a RequestStore
. After
performFetches
, all the requests in the RequestStore
are
complete, and all of the ResultVar
s are full.