butter-0.1.0.2: Monad Transformer for Asyncronous Message Passing
Distrib.Butter.Lib.Protocol
data Result p Source #
Constructors
class (ToJSON p, FromJSON p) => Protocol p where Source #
Minimal complete definition
setup, handle
Associated Types
data State p Source #
type Context p :: * -> * Source #
Methods
setup :: (MonadIO (Context p), ForkableMonad (Context p)) => p -> Butter (Context p) (State p) Source #
handle :: (MonadIO (Context p), ForkableMonad (Context p)) => p -> State p -> Butter (Context p) (Result p) Source #
start :: (MonadIO (Context p), ForkableMonad (Context p), Protocol p) => p -> Butter (Context p) ProcessID Source #
call :: (MonadIO (Context p), ForkableMonad (Context p), Protocol p) => ProcessID -> p -> Butter (Context p) p Source #
cast :: (MonadIO (Context p), ForkableMonad (Context p), Protocol p) => ProcessID -> p -> Butter (Context p) () Source #