Hets - the Heterogeneous Tool Set
LicenseGPLv2 or higher, see LICENSE.txt
MaintainerDaniel Hackbarth <da_ha@uni-bremen.de>
Safe HaskellNone

PGIP.RequestCache

Description

 
Synopsis

Documentation

data RequestMapKey Source #

Holds all necessary informations for caching a request

Constructors

RequestMapKey 

Fields

Instances

Instances details
Eq RequestMapKey Source # 
Instance details

Defined in PGIP.RequestCache

Ord RequestMapKey Source # 
Instance details

Defined in PGIP.RequestCache

Show RequestMapKey Source # 
Instance details

Defined in PGIP.RequestCache

Methods

showsPrec :: Int -> RequestMapKey -> ShowS

show :: RequestMapKey -> String

showList :: [RequestMapKey] -> ShowS

createNewRequestCache :: IO (IORef RequestCacheMap) Source #

Returns a new request cache.

updateCache :: IORef ByteString -> Request -> Response -> IORef RequestCacheMap -> IO () Source #

Update the request cache by first building the key and then perform the update

updateCacheWithKey :: RequestMapKey -> Response -> IORef RequestCacheMap -> IO () Source #

Update the request cache with a new request/response pair.

lookupCache :: RequestMapKey -> IORef RequestCacheMap -> IO (Maybe Response) Source #

Checks the request cache for a request that could already be cached. Returns the cached response or Nothing if the request is not cached.

convertRequestToMapKey :: Request -> ByteString -> IO RequestMapKey Source #

Converts a given request to a key that can be used for a request cache. The original request body needs to be passed too because in the original request the request body is already consumed.