glue-0.1.1.1: Make better services.

Safe HaskellNone
LanguageHaskell2010

Glue.Types

Description

Module containing the root types and some support functionality.

Synopsis

Documentation

type BasicService m a b = a -> m b Source

Type alias for the most basic form of a service supported.

type MultiGetService m a b = BasicService m (MultiGetRequest a) (MultiGetResponse a b) Source

Type alias for a service that looks up multiple values and returns multiple results.

type MultiGetRequest a = HashSet a Source

Type alias for the request portion of a MultiGetService.

type MultiGetResponse a b = HashMap a b Source

Type alias for the response portion of a MultiGetService.

type ResultVar a = MVar (Either SomeException a) Source

Type alias for the common container of a result used in asynchronous calls.

multiGetToBasic :: (Hashable a, Eq a, Monad m) => MultiGetService m a b -> BasicService m a (Maybe b) Source

Convert a MultiGetService into a BasicService that looks up a single key, returning a Maybe which determines if the value was present.

getResult :: MonadBaseControl IO m => ResultVar a -> m a Source

Obtain a result from a ResultVar in the Monad of your choice.