happstack-plugins-6.0.2: The haskell application server stack + reload

Happstack.Server.Plugins.Dynamic

Synopsis

Documentation

initPlugins :: IO PluginHandleSource

initialize the plugin system and return a PluginHandle

withServerPart :: Name -> ExpQSource

dynamically load the specified symbol pass it as an argument to the supplied server monad function.

This is a wrapper aronud withServerPart_ which ensures the first and second argument stay in-sync.

Usage:

 $(withServerPart 'symbol) pluginHandle $ \a -> ...

withServerPart_Source

Arguments

:: (MonadIO m, ServerMonad m, FilterMonad Response m, WebMonad Response m) 
=> Name

name of the symbol to dynamically load

-> a

the symbol (must be the function refered to by the Name argument)

-> PluginHandle

Handle to the function reloader

-> (a -> m b)

function which uses the loaded result

-> m b 

dynamically load the specified symbol pass it as an argument to the supplied server monad function.

If something fails, this function will return '500 Internal Server Error' and a list of the errors encountered.

see also: withServerPart