1{-# LANGUAGE DeriveDataTypeable #-}
2{-# LANGUAGE DeriveGeneric #-}
3{-# LANGUAGE StandaloneDeriving #-}
4{-# LANGUAGE ExistentialQuantification #-}
5{-# LANGUAGE ScopedTypeVariables #-}
6{-# LANGUAGE PatternGuards #-}
7{-# LANGUAGE RecordWildCards #-}
8{-# LANGUAGE FlexibleInstances #-}
9{-# LANGUAGE UndecidableInstances #-}
11-----------------------------------------------------------------------------
13-- Module : Control.Distributed.Process.Management
14-- Copyright : (c) Well-Typed / Tim Watson
15-- License : BSD3 (see the file LICENSE)
17-- Maintainer : Tim Watson <watson.timothy@gmail.com>
18-- Stability : experimental
19-- Portability : non-portable (requires concurrency)
21-- /Management Extensions/ for Cloud Haskell.
23-- This module provides a standard API for monitoring and/or responding to
24-- system events in a Cloud Haskell node.
26-- [Architecture Overview]
28-- /Management Extensions/ can be used by infrastructure or application code
29-- to provide access to runtime instrumentation data, expose control planes
30-- and/or provide remote access to external clients.
32-- The management infrastructure is broken down into three components, which
33-- roughly correspond to the modules it exposes:
35-- 1. @Agent@ - registration and management of /Management Agents/
36-- 2. @Instrumentation@ - provides an API for publishing /instrumentation data/
37-- 3. @Remote@ - provides an API for remote management and administration
41-----------------------------------------------------------------------------
42module Control.Distributed.Process.Management where
44import Control.Applicative ((<$>))
45import Control.Distributed.Process.Internal.Types
52 , unsafeCreateUnencodedMessage
54import Control.Distributed.Process.Management.Bus (publishEvent)
55import Control.Distributed.Process.Serializable (Serializable)
56import Control.Monad.IO.Class (liftIO)
57import Control.Monad.Reader (ask)
59-- | Publishes an arbitrary @Serializable@ message to the management event bus.
60-- Note that /no attempt is made to force the argument/, therefore it is very
61-- important that you do not pass unevaluated thunks that might crash the
62-- receiving process via this API, since /all/ registered agents will gain
63-- access to the data structure once it is broadcast by the agent controller.
64mxNotify :: (Serializable a) => a -> Process ()
66 bus <- localEventBus . processNode <$> ask
67 liftIO $ publishEvent bus $ unsafeCreateUnencodedMessage msg
69mxAgent :: (Message -> Process ()) -> Process ProcessId
71 node <- processNode <$> ask
72 pid <- liftIO $ mxNew (localEventBus node) handler
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list