haxl-0.1.0.0: A Haskell library for efficient, concurrent, and concise data access.

Safe HaskellNone

Haxl.Core.Fetch

Description

Generic fetching infrastructure, used by Monad.

Synopsis

Documentation

data CacheResult a Source

Possible responses when checking the cache.

Constructors

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 ResultVars are full.