-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Cloud Haskell Extras -- -- Supporting library, providing common types and utilities used by the -- various components that make up the distributed-process-platform -- package. @package distributed-process-extras @version 0.2.1.1 -- | If you don't know exactly what this module is for and precisely how to -- use the types within, you should move on, quickly! module Control.Distributed.Process.Extras.Internal.Unsafe data PCopy a -- | Wrap any Typeable datum in a PCopy. We hide the -- constructor to discourage arbitrary uses of the type, since -- PCopy is a specialised and potentially dangerous construct. pCopy :: (Typeable a) => a -> PCopy a -- | Matches on PCopy m and returns the m within. This -- potentially allows us to bypass serialization (and the type -- constraints it enforces) for local message passing (i.e., with -- UnencodedMessage data), since PCopy is just a shim. matchP :: (Typeable m) => Match (Maybe m) -- | Matches on a TypedChannel (PCopy a). matchChanP :: (Typeable m) => ReceivePort (PCopy m) -> Match m -- | Given a raw Message, attempt to unwrap a Typeable -- datum from an enclosing PCopy wrapper. pUnwrap :: (Typeable m) => Message -> Process (Maybe m) -- | A generic input channel that can be read from in the same fashion as a -- typed channel (i.e., ReceivePort). To read from an input -- stream in isolation, see readInputStream. To compose an -- InputStream with reads on a process' mailbox (and/or typed -- channels), see matchInputStream. data InputStream a Null :: InputStream a -- | Create a new InputStream. newInputStream :: (Typeable a) => Either (ReceivePort a) (STM a) -> InputStream a -- | Constructs a Match for a given InputChannel. matchInputStream :: InputStream a -> Match a -- | Read from an InputStream. This is a blocking operation. readInputStream :: (Serializable a) => InputStream a -> Process a data InvalidBinaryShim InvalidBinaryShim :: InvalidBinaryShim instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Internal.Unsafe.C1_0NullInputStream instance GHC.Generics.Datatype Control.Distributed.Process.Extras.Internal.Unsafe.D1NullInputStream instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Internal.Unsafe.C1_0PCopy instance GHC.Generics.Datatype Control.Distributed.Process.Extras.Internal.Unsafe.D1PCopy instance GHC.Classes.Eq Control.Distributed.Process.Extras.Internal.Unsafe.NullInputStream instance GHC.Show.Show Control.Distributed.Process.Extras.Internal.Unsafe.NullInputStream instance GHC.Generics.Generic Control.Distributed.Process.Extras.Internal.Unsafe.NullInputStream instance GHC.Generics.Generic (Control.Distributed.Process.Extras.Internal.Unsafe.PCopy a) instance GHC.Classes.Eq Control.Distributed.Process.Extras.Internal.Unsafe.InvalidBinaryShim instance GHC.Show.Show Control.Distributed.Process.Extras.Internal.Unsafe.InvalidBinaryShim instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Control.Distributed.Process.Extras.Internal.Unsafe.PCopy a) instance Data.Typeable.Internal.Typeable a => Data.Binary.Class.Binary (Control.Distributed.Process.Extras.Internal.Unsafe.PCopy a) instance Data.Binary.Class.Binary Control.Distributed.Process.Extras.Internal.Unsafe.NullInputStream instance Control.DeepSeq.NFData Control.Distributed.Process.Extras.Internal.Unsafe.NullInputStream module Control.Distributed.Process.Extras.Internal.Queue.PriorityQ newtype PriorityQ k a PriorityQ :: PQueue k a -> PriorityQ k a [q] :: PriorityQ k a -> PQueue k a empty :: Ord k => PriorityQ k v isEmpty :: Ord k => PriorityQ k v -> Bool singleton :: Ord k => k -> a -> PriorityQ k a enqueue :: Ord k => k -> v -> PriorityQ k v -> PriorityQ k v dequeue :: Ord k => PriorityQ k v -> Maybe (v, PriorityQ k v) peek :: Ord k => PriorityQ k v -> Maybe v -- | A simple FIFO queue implementation backed by Data.Sequence. module Control.Distributed.Process.Extras.Internal.Queue.SeqQ data SeqQ a empty :: SeqQ a isEmpty :: SeqQ a -> Bool singleton :: a -> SeqQ a enqueue :: SeqQ a -> a -> SeqQ a dequeue :: SeqQ a -> Maybe (a, SeqQ a) peek :: SeqQ a -> Maybe a instance GHC.Show.Show a => GHC.Show.Show (Control.Distributed.Process.Extras.Internal.Queue.SeqQ.SeqQ a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Control.Distributed.Process.Extras.Internal.Queue.SeqQ.SeqQ a) module Control.Distributed.Process.Extras.Internal.Containers.MultiMap -- | Opaque type of MultiMaps. data MultiMap k v -- | Class of things that can be inserted in a map or a set (of mapped -- values), for which instances of Eq and Hashable must -- be present. class (Eq a, Hashable a) => Insertable a empty :: MultiMap k v insert :: (Insertable k, Insertable v) => k -> v -> MultiMap k v -> MultiMap k v member :: (Insertable k) => k -> MultiMap k a -> Bool lookup :: (Insertable k) => k -> MultiMap k v -> Maybe [v] filter :: (Insertable k) => (v -> Bool) -> MultiMap k v -> MultiMap k v filterWithKey :: (Insertable k) => (k -> v -> Bool) -> MultiMap k v -> MultiMap k v toList :: MultiMap k v -> [(k, v)] instance (GHC.Classes.Eq a, Data.Hashable.Class.Hashable a) => Control.Distributed.Process.Extras.Internal.Containers.MultiMap.Insertable a instance Data.Foldable.Foldable (Control.Distributed.Process.Extras.Internal.Containers.MultiMap.MultiMap k) module Control.Concurrent.Utils data Lock class Exclusive a new :: Exclusive a => IO a acquire :: (Exclusive a, MonadIO m) => a -> m () release :: (Exclusive a, MonadIO m) => a -> m () class Synchronised e m where synchronized = synchronised synchronised :: (Synchronised e m, Exclusive e, Monad m) => e -> m b -> m b synchronized :: (Synchronised e m, Exclusive e, Monad m) => e -> m b -> m b withLock :: (Exclusive e) => e -> IO a -> IO a instance Control.Concurrent.Utils.Exclusive Control.Concurrent.Utils.Lock instance Control.Concurrent.Utils.Synchronised Control.Concurrent.Utils.Lock GHC.Types.IO instance Control.Concurrent.Utils.Synchronised Control.Concurrent.Utils.Lock Control.Distributed.Process.Internal.Types.Process -- | Types used throughout the Extras package module Control.Distributed.Process.Extras.Internal.Types -- | Tags provide uniqueness for messages, so that they can be matched with -- their response. type Tag = Int -- | Generates unique Tag for messages and response pairs. Each -- process that depends, directly or indirectly, on the call mechanisms -- in Control.Distributed.Process.Global.Call should have at most -- one TagPool on which to draw unique message tags. type TagPool = MVar Tag -- | Create a new per-process source of unique message identifiers. newTagPool :: Process TagPool -- | Extract a new identifier from a TagPool. getTag :: TagPool -> Process Tag -- | Class of things to which a Process can link itself. class Linkable a -- | Create a link with the supplied object. linkTo :: Linkable a => a -> Process () -- | Class of things that can be killed (or instructed to exit). class Killable a killProc :: Killable a => a -> String -> Process () exitProc :: (Killable a, Serializable m) => a -> m -> Process () -- | Class of things that can be resolved to a ProcessId. class Resolvable a -- | Resolve the reference to a process id, or Nothing if -- resolution fails resolve :: Resolvable a => a -> Process (Maybe ProcessId) -- | Provides a unified API for addressing processes. class Routable a where unresolvableMessage = baseAddressableErrorMessage -- | Send a message to the target asynchronously sendTo :: (Routable a, Serializable m) => a -> m -> Process () -- | Send some NFData message to the target asynchronously, -- forcing evaluation (i.e., deepseq) beforehand. unsafeSendTo :: (Routable a, NFSerializable m) => a -> m -> Process () -- | Unresolvable Addressable Message unresolvableMessage :: Routable a => a -> String class (Resolvable a, Routable a) => Addressable a sendToRecipient :: (Serializable m) => Recipient -> m -> Process () -- | A simple means of mapping to a receiver. data Recipient Pid :: !ProcessId -> Recipient Registered :: !String -> Recipient RemoteRegistered :: !String -> !NodeId -> Recipient -- | Used internally in whereisOrStart. Sent as (RegisterSelf,ProcessId). data RegisterSelf RegisterSelf :: RegisterSelf -- | A synchronous version of whereis, this relies on call to -- perform the relevant monitoring of the remote node. whereisRemote :: NodeId -> String -> Process (Maybe ProcessId) -- | resolve the Resolvable or die with specified msg plus details of what -- didn't resolve resolveOrDie :: (Routable a, Resolvable a) => a -> String -> Process ProcessId -- | Wait cancellation message. data CancelWait CancelWait :: CancelWait -- | Simple representation of a channel. type Channel a = (SendPort a, ReceivePort a) -- | A ubiquitous shutdown signal that can be used to maintain a -- consistent shutdown/stop protocol for any process that wishes to -- handle it. data Shutdown Shutdown :: Shutdown -- | Provides a reason for process termination. data ExitReason -- | indicates normal exit ExitNormal :: ExitReason -- | normal response to a Shutdown ExitShutdown :: ExitReason -- | abnormal (error) shutdown ExitOther :: !String -> ExitReason -- | Given when a server is unobtainable. data ServerDisconnected ServerDisconnected :: !DiedReason -> ServerDisconnected -- | Introduces a class that brings NFData into scope along with -- Serializable, such that we can force evaluation. Intended for use with -- the UnsafePrimitives module (which wraps -- Control.Distributed.Process.UnsafePrimitives), and guarantees -- evaluatedness in terms of NFData. Please note that we -- cannot guarantee that an NFData instance will behave -- the same way as a Binary one with regards evaluation, so it -- is still possible to introduce unexpected behaviour by using -- unsafe primitives in this way. class (NFData a, Serializable a) => NFSerializable a __remoteTable :: RemoteTable -> RemoteTable instance Control.Distributed.Process.Extras.Internal.Types.Killable Control.Distributed.Process.Internal.Types.ProcessId instance Control.Distributed.Process.Extras.Internal.Types.Resolvable r => Control.Distributed.Process.Extras.Internal.Types.Killable r instance Control.Distributed.Process.Extras.Internal.Types.Resolvable a => Control.Distributed.Process.Extras.Internal.Types.Routable a instance Control.Distributed.Process.Extras.Internal.Types.Resolvable Control.Distributed.Process.Extras.Internal.Types.Recipient instance Control.Distributed.Process.Extras.Internal.Types.Routable Control.Distributed.Process.Extras.Internal.Types.Recipient instance Control.Distributed.Process.Extras.Internal.Types.Resolvable Control.Distributed.Process.Internal.Types.ProcessId instance Control.Distributed.Process.Extras.Internal.Types.Routable Control.Distributed.Process.Internal.Types.ProcessId instance Control.Distributed.Process.Extras.Internal.Types.Resolvable GHC.Base.String instance Control.Distributed.Process.Extras.Internal.Types.Routable GHC.Base.String instance Control.Distributed.Process.Extras.Internal.Types.Resolvable (Control.Distributed.Process.Internal.Types.NodeId, GHC.Base.String) instance Control.Distributed.Process.Extras.Internal.Types.Routable (Control.Distributed.Process.Internal.Types.NodeId, GHC.Base.String) instance Control.Distributed.Process.Extras.Internal.Types.Routable (Control.Distributed.Process.Internal.Types.Message -> Control.Distributed.Process.Internal.Types.Process ()) instance (Control.Distributed.Process.Extras.Internal.Types.Resolvable a, Control.Distributed.Process.Extras.Internal.Types.Routable a) => Control.Distributed.Process.Extras.Internal.Types.Addressable a instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Internal.Types.C1_0ServerDisconnected instance GHC.Generics.Datatype Control.Distributed.Process.Extras.Internal.Types.D1ServerDisconnected instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Internal.Types.C1_2Recipient instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Internal.Types.C1_1Recipient instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Internal.Types.C1_0Recipient instance GHC.Generics.Datatype Control.Distributed.Process.Extras.Internal.Types.D1Recipient instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Internal.Types.C1_2ExitReason instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Internal.Types.C1_1ExitReason instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Internal.Types.C1_0ExitReason instance GHC.Generics.Datatype Control.Distributed.Process.Extras.Internal.Types.D1ExitReason instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Internal.Types.C1_0Shutdown instance GHC.Generics.Datatype Control.Distributed.Process.Extras.Internal.Types.D1Shutdown instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Internal.Types.C1_0RegisterSelf instance GHC.Generics.Datatype Control.Distributed.Process.Extras.Internal.Types.D1RegisterSelf instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Internal.Types.C1_0CancelWait instance GHC.Generics.Datatype Control.Distributed.Process.Extras.Internal.Types.D1CancelWait instance GHC.Generics.Generic Control.Distributed.Process.Extras.Internal.Types.ServerDisconnected instance GHC.Classes.Eq Control.Distributed.Process.Extras.Internal.Types.Recipient instance GHC.Show.Show Control.Distributed.Process.Extras.Internal.Types.Recipient instance GHC.Generics.Generic Control.Distributed.Process.Extras.Internal.Types.Recipient instance GHC.Show.Show Control.Distributed.Process.Extras.Internal.Types.ExitReason instance GHC.Classes.Eq Control.Distributed.Process.Extras.Internal.Types.ExitReason instance GHC.Generics.Generic Control.Distributed.Process.Extras.Internal.Types.ExitReason instance GHC.Classes.Eq Control.Distributed.Process.Extras.Internal.Types.Shutdown instance GHC.Show.Show Control.Distributed.Process.Extras.Internal.Types.Shutdown instance GHC.Generics.Generic Control.Distributed.Process.Extras.Internal.Types.Shutdown instance GHC.Generics.Generic Control.Distributed.Process.Extras.Internal.Types.RegisterSelf instance GHC.Generics.Generic Control.Distributed.Process.Extras.Internal.Types.CancelWait instance GHC.Show.Show Control.Distributed.Process.Extras.Internal.Types.CancelWait instance GHC.Classes.Eq Control.Distributed.Process.Extras.Internal.Types.CancelWait instance (Control.DeepSeq.NFData a, Control.Distributed.Process.Serializable.Serializable a) => Control.Distributed.Process.Extras.Internal.Types.NFSerializable a instance Data.Binary.Class.Binary Control.Distributed.Process.Extras.Internal.Types.CancelWait instance Control.DeepSeq.NFData Control.Distributed.Process.Extras.Internal.Types.CancelWait instance Data.Binary.Class.Binary Control.Distributed.Process.Extras.Internal.Types.RegisterSelf instance Control.DeepSeq.NFData Control.Distributed.Process.Extras.Internal.Types.RegisterSelf instance Data.Binary.Class.Binary Control.Distributed.Process.Extras.Internal.Types.Shutdown instance Control.DeepSeq.NFData Control.Distributed.Process.Extras.Internal.Types.Shutdown instance Data.Binary.Class.Binary Control.Distributed.Process.Extras.Internal.Types.ExitReason instance Control.DeepSeq.NFData Control.Distributed.Process.Extras.Internal.Types.ExitReason instance Data.Binary.Class.Binary Control.Distributed.Process.Extras.Internal.Types.Recipient instance Control.DeepSeq.NFData Control.Distributed.Process.Extras.Internal.Types.Recipient instance Data.Binary.Class.Binary Control.Distributed.Process.Extras.Internal.Types.ServerDisconnected instance Control.DeepSeq.NFData Control.Distributed.Process.Extras.Internal.Types.ServerDisconnected -- | Maintainers : Jeff Epstein, Tim Watson Stability : experimental -- Portability : non-portable (requires concurrency) -- -- This module provides a set of additional primitives that add -- functionality to the basic Cloud Haskell APIs. module Control.Distributed.Process.Extras.Internal.Primitives class (Resolvable a, Routable a) => Addressable a -- | Provides a unified API for addressing processes. class Routable a where unresolvableMessage = baseAddressableErrorMessage -- | Send a message to the target asynchronously sendTo :: (Routable a, Serializable m) => a -> m -> Process () -- | Send some NFData message to the target asynchronously, -- forcing evaluation (i.e., deepseq) beforehand. unsafeSendTo :: (Routable a, NFSerializable m) => a -> m -> Process () -- | Unresolvable Addressable Message unresolvableMessage :: Routable a => a -> String -- | Class of things that can be resolved to a ProcessId. class Resolvable a -- | Resolve the reference to a process id, or Nothing if -- resolution fails resolve :: Resolvable a => a -> Process (Maybe ProcessId) -- | Class of things to which a Process can link itself. class Linkable a -- | Create a link with the supplied object. linkTo :: Linkable a => a -> Process () -- | Class of things that can be killed (or instructed to exit). class Killable a killProc :: Killable a => a -> String -> Process () exitProc :: (Killable a, Serializable m) => a -> m -> Process () -- | Spawn a new (local) process. This variant takes an initialisation -- action and a secondary expression from the result of the -- initialisation to Process (). The spawn operation -- synchronises on the completion of the before action, such -- that the calling process is guaranteed to only see the newly spawned -- ProcessId once the initialisation has successfully completed. spawnSignalled :: Process a -> (a -> Process ()) -> Process ProcessId -- | Node local version of spawnLink. Note that this is just the -- sequential composition of spawn and link. (The -- Unified semantics that underlies Cloud Haskell does not even -- support a synchronous link operation) spawnLinkLocal :: Process () -> Process ProcessId -- | Like spawnLinkLocal, but monitors the spawned process. spawnMonitorLocal :: Process () -> Process (ProcessId, MonitorRef) -- | CH's link primitive, unlike Erlang's, will trigger when the -- target process dies for any reason. This function has semantics like -- Erlang's: it will trigger ProcessLinkException only when the -- target dies abnormally. linkOnFailure :: ProcessId -> Process () -- | A synchronous version of whereis, this relies on call to -- perform the relevant monitoring of the remote node. whereisRemote :: NodeId -> String -> Process (Maybe ProcessId) -- | Returns the pid of the process that has been registered under the -- given name. This refers to a local, per-node registration, not -- global registration. If that name is unregistered, a process -- is started. This is a handy way to start per-node named servers. whereisOrStart :: String -> Process () -> Process ProcessId -- | A remote equivalent of whereisOrStart. It deals with the node -- registry on the given node, and the process, if it needs to be -- started, will run on that node. If the node is inaccessible, Nothing -- will be returned. whereisOrStartRemote :: NodeId -> String -> Closure (Process ()) -> Process (Maybe ProcessId) -- | An alternative to matchIf that allows both predicate and action -- to be expressed in one parameter. matchCond :: (Serializable a) => (a -> Maybe (Process b)) -> Match b -- | Safe (i.e., monitored) waiting on an expected response/message. awaitResponse :: Addressable a => a -> [Match (Either ExitReason b)] -> Process (Either ExitReason b) -- | Apply the supplied expression n times times :: Int -> Process () -> Process () -- | Monitor any Resolvable object. monitor :: Resolvable a => a -> Process (Maybe MonitorRef) awaitExit :: Resolvable a => a -> Process () isProcessAlive :: ProcessId -> Process Bool -- | Like forever but sans space leak forever' :: Monad m => m a -> m b deliver :: (Addressable a, Serializable m) => m -> a -> Process () __remoteTable :: RemoteTable -> RemoteTable -- | This module provides facilities for working with time delays and -- timeouts. The type Timeout and the timeout family of -- functions provide mechanisms for working with -- threadDelay-like behaviour that operates on microsecond -- values. -- -- The TimeInterval and TimeUnit related functions provide -- an abstraction for working with various time intervals, whilst the -- Delay type provides a corrolary to timeout that works -- with these. module Control.Distributed.Process.Extras.Time -- | given a number, produces a TimeInterval of microseconds microSeconds :: Int -> TimeInterval -- | given a number, produces a TimeInterval of milliseconds milliSeconds :: Int -> TimeInterval -- | given a number, produces a TimeInterval of seconds seconds :: Int -> TimeInterval -- | given a number, produces a TimeInterval of minutes minutes :: Int -> TimeInterval -- | given a number, produces a TimeInterval of hours hours :: Int -> TimeInterval -- | converts the supplied TimeInterval to microseconds asTimeout :: TimeInterval -> Int -- | Convenience for making timeouts; e.g., -- --
-- receiveTimeout (after 3 Seconds) [ match (\"ok" -> return ()) ] --after :: Int -> TimeUnit -> Int -- | Convenience for making TimeInterval; e.g., -- --
-- let ti = within 5 Seconds in ..... --within :: Int -> TimeUnit -> TimeInterval -- | converts the supplied TimeUnit to microseconds timeToMicros :: TimeUnit -> Int -> Int -- | A time interval. data TimeInterval -- | Defines the time unit for a Timeout value data TimeUnit Days :: TimeUnit Hours :: TimeUnit Minutes :: TimeUnit Seconds :: TimeUnit Millis :: TimeUnit Micros :: TimeUnit -- | Represents either a delay of TimeInterval, an infinite wait or -- no delay (i.e., non-blocking). data Delay Delay :: TimeInterval -> Delay Infinity :: Delay NoDelay :: Delay -- | given a TimeInterval, provide an equivalent -- NominalDiffTim timeIntervalToDiffTime :: TimeInterval -> NominalDiffTime -- | given a NominalDiffTim, provide an equivalent -- TimeInterval@ diffTimeToTimeInterval :: NominalDiffTime -> TimeInterval -- | given a NominalDiffTim, provide an equivalent Delay@ diffTimeToDelay :: NominalDiffTime -> Delay -- | given a Delay, provide an equivalent NominalDiffTim delayToDiffTime :: Delay -> NominalDiffTime -- | Create a NominalDiffTime from a number of microseconds. microsecondsToNominalDiffTime :: Integer -> NominalDiffTime -- | Represents a timeout in terms of microseconds, where -- Nothing stands for infinity and Just 0, no-delay. type Timeout = Maybe Int -- | Send to a process when a timeout expires. data TimeoutNotification TimeoutNotification :: Tag -> TimeoutNotification -- | Sends the calling process TimeoutNotification tag after -- time microseconds timeout :: Int -> Tag -> ProcessId -> Process () -- | Constructs an inifinite Timeout. infiniteWait :: Timeout -- | Constructs a no-wait Timeout noWait :: Timeout instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Time.C1_2Delay instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Time.C1_1Delay instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Time.C1_0Delay instance GHC.Generics.Datatype Control.Distributed.Process.Extras.Time.D1Delay instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Time.C1_0TimeInterval instance GHC.Generics.Datatype Control.Distributed.Process.Extras.Time.D1TimeInterval instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Time.C1_5TimeUnit instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Time.C1_4TimeUnit instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Time.C1_3TimeUnit instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Time.C1_2TimeUnit instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Time.C1_1TimeUnit instance GHC.Generics.Constructor Control.Distributed.Process.Extras.Time.C1_0TimeUnit instance GHC.Generics.Datatype Control.Distributed.Process.Extras.Time.D1TimeUnit instance GHC.Show.Show Control.Distributed.Process.Extras.Time.Delay instance GHC.Classes.Eq Control.Distributed.Process.Extras.Time.Delay instance GHC.Generics.Generic Control.Distributed.Process.Extras.Time.Delay instance GHC.Show.Show Control.Distributed.Process.Extras.Time.TimeInterval instance GHC.Classes.Eq Control.Distributed.Process.Extras.Time.TimeInterval instance GHC.Generics.Generic Control.Distributed.Process.Extras.Time.TimeInterval instance GHC.Show.Show Control.Distributed.Process.Extras.Time.TimeUnit instance GHC.Classes.Eq Control.Distributed.Process.Extras.Time.TimeUnit instance GHC.Generics.Generic Control.Distributed.Process.Extras.Time.TimeUnit instance Data.Binary.Class.Binary Control.Distributed.Process.Extras.Time.TimeUnit instance Control.DeepSeq.NFData Control.Distributed.Process.Extras.Time.TimeUnit instance Data.Binary.Class.Binary Control.Distributed.Process.Extras.Time.TimeInterval instance Control.DeepSeq.NFData Control.Distributed.Process.Extras.Time.TimeInterval instance Data.Binary.Class.Binary Control.Distributed.Process.Extras.Time.Delay instance Control.DeepSeq.NFData Control.Distributed.Process.Extras.Time.Delay instance Data.Binary.Class.Binary Control.Distributed.Process.Extras.Time.TimeoutNotification instance GHC.Num.Num Control.Distributed.Process.Extras.Time.TimeInterval instance GHC.Num.Num Control.Distributed.Process.Extras.Time.Delay -- |
-- systemLogFile :: FilePath -> LogLevel -> LogFormat -> Process ProcessId -- systemLogFile path lvl fmt = do -- h <- liftIO $ openFile path AppendMode -- liftIO $ hSetBuffering h LineBuffering -- systemLog (liftIO . hPutStrLn h) (liftIO (hClose h)) lvl fmt --module Control.Distributed.Process.Extras.SystemLog data LogLevel Debug :: LogLevel Info :: LogLevel Notice :: LogLevel Warning :: LogLevel Error :: LogLevel Critical :: LogLevel Alert :: LogLevel Emergency :: LogLevel type LogFormat = String -> Process String data LogClient type LogChan = () data LogText LogText :: !String -> LogText [txt] :: LogText -> !String class ToLog m toLog :: ToLog m => m -> Process (LogLevel -> LogMessage) class Logger a logMessage :: Logger a => a -> LogMessage -> Process () mxLogId :: MxAgentId -- | Start a system logger process as a management agent. systemLog :: (String -> Process ()) -> (Process ()) -> LogLevel -> LogFormat -> Process ProcessId client :: Process (Maybe LogClient) logChannel :: LogChan addFormatter :: (Routable r) => r -> Closure (Message -> Process (Maybe String)) -> Process () -- | Start a system logger that writes to a file. -- -- This is a very basic file logging facility, that uses -- regular buffered file I/O (i.e., System.IO.hPutStrLn -- et al) under the covers. The handle is closed appropriately if/when -- the logging process terminates. -- -- See -- Control.Distributed.Process.Management.mxAgentWithFinalize -- for futher details about management agents that use finalizers. systemLogFile :: FilePath -> LogLevel -> LogFormat -> Process ProcessId report :: (Logger l) => (l -> LogText -> Process ()) -> l -> String -> Process () debug :: (Logger l, ToLog m) => l -> m -> Process () info :: (Logger l, ToLog m) => l -> m -> Process () notice :: (Logger l, ToLog m) => l -> m -> Process () warning :: (Logger l, ToLog m) => l -> m -> Process () error :: (Logger l, ToLog m) => l -> m -> Process () critical :: (Logger l, ToLog m) => l -> m -> Process () alert :: (Logger l, ToLog m) => l -> m -> Process () emergency :: (Logger l, ToLog m) => l -> m -> Process () sendLog :: (Logger l, ToLog m) => l -> m -> LogLevel -> Process () instance GHC.Generics.Constructor Control.Distributed.Process.Extras.SystemLog.C1_1LogMessage instance GHC.Generics.Constructor Control.Distributed.Process.Extras.SystemLog.C1_0LogMessage instance GHC.Generics.Datatype Control.Distributed.Process.Extras.SystemLog.D1LogMessage instance GHC.Generics.Constructor Control.Distributed.Process.Extras.SystemLog.C1_0AddFormatter instance GHC.Generics.Datatype Control.Distributed.Process.Extras.SystemLog.D1AddFormatter instance GHC.Generics.Constructor Control.Distributed.Process.Extras.SystemLog.C1_0SetLevel instance GHC.Generics.Datatype Control.Distributed.Process.Extras.SystemLog.D1SetLevel instance GHC.Generics.Constructor Control.Distributed.Process.Extras.SystemLog.C1_7LogLevel instance GHC.Generics.Constructor Control.Distributed.Process.Extras.SystemLog.C1_6LogLevel instance GHC.Generics.Constructor Control.Distributed.Process.Extras.SystemLog.C1_5LogLevel instance GHC.Generics.Constructor Control.Distributed.Process.Extras.SystemLog.C1_4LogLevel instance GHC.Generics.Constructor Control.Distributed.Process.Extras.SystemLog.C1_3LogLevel instance GHC.Generics.Constructor Control.Distributed.Process.Extras.SystemLog.C1_2LogLevel instance GHC.Generics.Constructor Control.Distributed.Process.Extras.SystemLog.C1_1LogLevel instance GHC.Generics.Constructor Control.Distributed.Process.Extras.SystemLog.C1_0LogLevel instance GHC.Generics.Datatype Control.Distributed.Process.Extras.SystemLog.D1LogLevel instance GHC.Show.Show Control.Distributed.Process.Extras.SystemLog.LogMessage instance GHC.Generics.Generic Control.Distributed.Process.Extras.SystemLog.LogMessage instance Control.DeepSeq.NFData Control.Distributed.Process.Extras.SystemLog.AddFormatter instance GHC.Generics.Generic Control.Distributed.Process.Extras.SystemLog.AddFormatter instance GHC.Generics.Generic Control.Distributed.Process.Extras.SystemLog.SetLevel instance GHC.Enum.Enum Control.Distributed.Process.Extras.SystemLog.LogLevel instance GHC.Classes.Ord Control.Distributed.Process.Extras.SystemLog.LogLevel instance GHC.Show.Show Control.Distributed.Process.Extras.SystemLog.LogLevel instance GHC.Read.Read Control.Distributed.Process.Extras.SystemLog.LogLevel instance GHC.Classes.Eq Control.Distributed.Process.Extras.SystemLog.LogLevel instance GHC.Generics.Generic Control.Distributed.Process.Extras.SystemLog.LogLevel instance Data.Binary.Class.Binary Control.Distributed.Process.Extras.SystemLog.LogLevel instance Control.DeepSeq.NFData Control.Distributed.Process.Extras.SystemLog.LogLevel instance Data.Binary.Class.Binary Control.Distributed.Process.Extras.SystemLog.SetLevel instance Control.DeepSeq.NFData Control.Distributed.Process.Extras.SystemLog.SetLevel instance Data.Binary.Class.Binary Control.Distributed.Process.Extras.SystemLog.AddFormatter instance Data.Binary.Class.Binary Control.Distributed.Process.Extras.SystemLog.LogMessage instance Control.DeepSeq.NFData Control.Distributed.Process.Extras.SystemLog.LogMessage instance Control.Distributed.Process.Extras.Internal.Types.Routable Control.Distributed.Process.Extras.SystemLog.LogChan instance Control.Distributed.Process.Extras.Internal.Types.Resolvable Control.Distributed.Process.Extras.SystemLog.LogClient instance Control.Distributed.Process.Extras.SystemLog.ToLog Control.Distributed.Process.Extras.SystemLog.LogText instance Control.Distributed.Process.Serializable.Serializable a => Control.Distributed.Process.Extras.SystemLog.ToLog a instance Control.Distributed.Process.Extras.SystemLog.ToLog Control.Distributed.Process.Internal.Types.Message instance Control.Distributed.Process.Extras.SystemLog.Logger Control.Distributed.Process.Extras.SystemLog.LogClient instance Control.Distributed.Process.Extras.SystemLog.Logger Control.Distributed.Process.Extras.SystemLog.LogChan