Safe Haskell | Safe-Infered |
---|
- type Cookie = (String, String, String, Maybe String)
- ctype :: ([Char], [Char])
- getCookies :: [([Char], [Char])] -> [([Char], [Char])]
- cookieHeaders :: [Cookie] -> [([Char], String)]
- urlDecode :: String -> [([(String, String)], String)]
- type Params = [(String, String)]
- getParam1 :: (Typeable a, Read a) => String -> Params -> Maybe a
- data Req = forall a . (Processable a, Typeable a) => Req a
- data Resp
- type Workflow m = WF Stat m
- data HttpData a = HttpData [Cookie] a
- class Processable a where
- class ConvertTo a b | a -> b where
- convert :: a -> b
- data Token = Token {}
- getToken :: Processable a => a -> IO Token
- data Error = Error String
- type ProcList = WorkflowList IO Token ()
- flushRec :: Token -> IO ()
- receive :: (Processable a, Typeable a) => Token -> IO a
- receiveReq :: Token -> IO Req
- receiveReqTimeout :: Int -> Integer -> Token -> IO Req
- send :: (Typeable a, Typeable b, ConvertTo a b) => Token -> a -> IO ()
- sendFlush :: (Typeable b, Typeable a, ConvertTo a b) => Token -> a -> IO ()
- sendFragment :: (Typeable a, Typeable b, Monoid b, ConvertTo a b) => Token -> a -> IO ()
- sendEndFragment :: (Typeable a, Typeable b, Monoid b, ConvertTo a b) => Token -> a -> IO ()
- msgScheduler :: (Processable a, Typeable a, ConvertTo Error c, Typeable c) => a -> ProcList -> IO (c, ThreadId)
- addMessageFlows :: [(String, Token -> Workflow IO ())] -> IO ()
- getMessageFlows :: IO ProcList
- transient :: (Token -> IO ()) -> Token -> Workflow IO ()
- stateless :: (Typeable a, Processable a, Typeable b, ConvertTo b c, Typeable c) => (a -> IO b) -> Token -> Workflow IO ()
- hackMessageFlow :: ProcList -> Env -> IO Response
Documentation
cookieHeaders :: [Cookie] -> [([Char], String)]Source
type Workflow m = WF Stat m
class Processable a whereSource
getToken :: Processable a => a -> IO TokenSource
type ProcList = WorkflowList IO Token ()Source
List of (wfname, workflow) pairs, to be scheduled depending on the message's pwfname
receiveReq :: Token -> IO ReqSource
send :: (Typeable a, Typeable b, ConvertTo a b) => Token -> a -> IO ()Source
send a complete response
sendFragment :: (Typeable a, Typeable b, Monoid b, ConvertTo a b) => Token -> a -> IO ()Source
send a response fragment. Useful for streaming. the last packet must sent trough send
msgScheduler :: (Processable a, Typeable a, ConvertTo Error c, Typeable c) => a -> ProcList -> IO (c, ThreadId)Source
transient :: (Token -> IO ()) -> Token -> Workflow IO ()Source
to add a monadic computation that send and receive messages, but does not store its state in permanent storage.
stateless :: (Typeable a, Processable a, Typeable b, ConvertTo b c, Typeable c) => (a -> IO b) -> Token -> Workflow IO ()Source
hackMessageFlow :: ProcList -> Env -> IO ResponseSource
An instance of the abstract MFlow scheduler to the Hack interface it accept the list of processes being scheduled and return a hack handler
Example:
main= do putStrLn $ options messageFlowsrun
80 $hackMessageFlow
messageFlows where messageFlows= [("main",runFlow
flowname ) ,("hello",stateless
statelesproc) ,("trans",transient
$ runflow transientflow] options msgs= "in the browser choose\n\n" ++ concat [ http://server/++ i ++ n | (i,_) <- msgs]