| Copyright | (c) Tim Watson 2013 - 2017 |
|---|---|
| License | BSD3 (see the file LICENSE) |
| Maintainer | Tim Watson <watson.timothy@gmail.com> |
| Stability | experimental |
| Portability | non-portable (requires concurrency) |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Control.Distributed.Process.Extras.Monitoring
Description
This module provides a primitive node monitoring capability, implemented as
a distributed-process Management Agent. Once the nodeMonitor agent is
started, calling monitorNodes will ensure that whenever the local node
detects a new network-transport connection (from another cloud haskell node),
the caller will receive a NodeUp message in its mailbox. If a node
disconnects, a corollary NodeDown message will be delivered as well.
Synopsis
- data NodeUp = NodeUp !NodeId
- data NodeDown = NodeDown !NodeId
- nodeMonitorAgentId :: MxAgentId
- nodeMonitor :: Process ProcessId
- monitorNodes :: Process ()
- unmonitorNodes :: Process ()
Documentation
Sent to subscribing processes when a connection (from a remote node) is detected.
Instances
| Generic NodeUp Source # | |
| Show NodeUp Source # | |
| Binary NodeUp Source # | |
| NFData NodeUp Source # | |
| type Rep NodeUp Source # | |
Defined in Control.Distributed.Process.Extras.Monitoring type Rep NodeUp = D1 ('MetaData "NodeUp" "Control.Distributed.Process.Extras.Monitoring" "distributed-process-extras-0.3.6-DsiO4vtFsmHD8G1zhPF1ni" 'False) (C1 ('MetaCons "NodeUp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NodeId))) | |
Sent to subscribing processes when a dis-connection (from a remote node) is detected.
Instances
| Generic NodeDown Source # | |
| Show NodeDown Source # | |
| Binary NodeDown Source # | |
| NFData NodeDown Source # | |
| type Rep NodeDown Source # | |
Defined in Control.Distributed.Process.Extras.Monitoring type Rep NodeDown = D1 ('MetaData "NodeDown" "Control.Distributed.Process.Extras.Monitoring" "distributed-process-extras-0.3.6-DsiO4vtFsmHD8G1zhPF1ni" 'False) (C1 ('MetaCons "NodeDown" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NodeId))) | |
nodeMonitorAgentId :: MxAgentId Source #
The MxAgentId for the node monitoring agent.
nodeMonitor :: Process ProcessId Source #
Starts the node monitoring agent. No call to monitorNodes and
unmonitorNodes will have any effect unless the agent is already
running. Note that we make no guarantees what-so-ever about the
timeliness or ordering semantics of node monitoring notifications.
monitorNodes :: Process () Source #
Start monitoring node connection/disconnection events. When a
connection event occurs, the calling process will receive a message
NodeUp NodeId in its mailbox. When a disconnect occurs, the
corollary NodeDown NodeId message will be delivered instead.
No guaranatee is made about the timeliness of the delivery, nor can the receiver expect that the node (for which it is being notified) is still upconnected or downdisconnected at the point when it receives a message from the node monitoring agent.
unmonitorNodes :: Process () Source #
Stop monitoring node connection/disconnection events. This does not flush the caller's mailbox, nor does it guarantee that any/all node up/down notifications will have been delivered before it is evaluated.