-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | simple 1-to-N interprocess communication -- -- This module provides interprocess communication channels. This is -- meant to be used by logger-like programs that want to send status -- reports to N listeners (where N >= 0). @package miniplex @version 0.2.2 -- | Synchronous message receiving. module System.Miniplex.Source data Source -- | attach tag returns a message source connected to the -- sink created by a call to System.Miniplex.Sink.create -- tag. If no such sink exists, an exception is thrown. attach :: String -> IO Source -- | Synchronously reads a message from a source (i.e. it blocks if there -- is currently no message available). read :: Source -> IO String -- | Returns a lazy list of all messages arriving at a source (like -- System.IO.hGetContents). getMsgs :: Source -> IO [String] -- | Disconnects from a message sink. The detached source becomes invalid -- and must not be used again. detach :: Source -> IO () -- | Helper function to simplify resource handling. withSource -- tag body creates a source, calls body, then disconnects -- the source, even if body throws an exception. withSource :: String -> (Source -> IO a) -> IO a instance Typeable Source -- | Asynchronous message broadcasting. module System.Miniplex.Sink data Sink -- | create tag creates a message sink. tag is -- used to uniquely identify this sink. The set of allowed characters for -- tag includes letters, digits, _, - and -- +. -- -- (Implementation detail: This function actually creates a named socket -- in your ~/.miniplex/.) create :: String -> IO Sink -- | write si msg asynchronously writes msg to -- si, where it will be received by all currently connected -- readers. write :: Sink -> String -> IO () -- | Deallocates a sink. The destroyed sink must not be used again. -- -- (Implementation detail: This function closes and removes the socket -- from the file system. If you forget to call it, you'll leave a stale -- entry in ~/.miniplex/, which will cause calls to -- create with the same tag to fail.) destroy :: Sink -> IO () -- | Helper function to simplify resource handling. withSink tag -- body creates a sink, calls body, then destroys the sink, -- even if body throws an exception. withSink :: String -> (Sink -> IO a) -> IO a instance Typeable Sink -- | Semisynchronous interprocess communication. module System.Miniplex