glue-0.1.2: Make better services.

Safe HaskellNone
LanguageHaskell2010

Glue.Preload

Description

Module containing a form of caching where values for given keys are preloaded ahead of time. | Once warmed up requests for preloaded keys will be instant, with the values refreshed in the background.

Synopsis

Documentation

data PreloadedOptions a Source

Options for determining behaviour of preloading services.

defaultPreloadedOptions :: HashSet a -> PreloadedOptions a Source

Defaulted options for preloading a HashSet of keys with a 30 second refresh time.

preloadingService Source

Arguments

:: (MonadIO m, MonadBaseControl IO m, Eq a, Hashable a) 
=> PreloadedOptions a

Instance of PreloadedOptions to configure the preloading functionality.

-> MultiGetService m a b

The service to perform preloading of.

-> m (MultiGetService m a b, () -> m ()) 

Preloads the results of calls for given keys.