Safe Haskell | None |
---|---|
Language | Haskell2010 |
"Serf is a service discovery and orchestration tool that is decentralized, highly available, and fault tolerant. Serf runs on every major platform: Linux, Mac OS X, and Windows. It is extremely lightweight: it uses 5 to 10 MB of resident memory and primarily communicates using infrequent UDP messages."
This module provides facilities for interacting with a serf agent running on a machine. This module aims to expose all functionality provided by the serf command-line tool in a programmatic way.
- type SerfM = Program Serf
- data Serf a where
- SendEvent :: SendOptions -> String -> Maybe String -> Serf Bool
- ForceLeave :: String -> Serf Bool
- JoinNodes :: JoinOptions -> String -> [String] -> Serf Bool
- Members :: Serf [MemberStatus]
- class Monad m => MonadSerf m where
- serf :: SerfM a -> IO a
- serfAt :: String -> SerfM a -> IO a
- serfWithOpts :: [String] -> SerfM a -> IO a
- sendEvent :: String -> Maybe String -> SerfM Bool
- sendEvent' :: SendOptions -> String -> Maybe String -> SerfM Bool
- data SendOptions = SendOptions {}
- forceLeave :: String -> SerfM Bool
- joinNodes :: String -> [String] -> SerfM Bool
- joinNodes' :: JoinOptions -> String -> [String] -> SerfM Bool
- data JoinOptions = JoinOptions {}
- members :: SerfM [MemberStatus]
- data MemberStatus = MemberStatus {}
- data LastKnownStatus
- data LogLevel
- data MonitorOptions = MonitorOptions {}
Documentation
Commands supported by the serf executable (serf protocol v1).
SendEvent :: SendOptions -> String -> Maybe String -> Serf Bool | |
ForceLeave :: String -> Serf Bool | |
JoinNodes :: JoinOptions -> String -> [String] -> Serf Bool | |
Members :: Serf [MemberStatus] |
class Monad m => MonadSerf m where Source
A convenience class for lifting serf action evaluation into monad transformer stacks.
serfWithOpts :: [String] -> SerfM a -> IO a Source
Run serf actions with a list of arbitrary command line arguments.
:: String | The name of the custom event. |
-> Maybe String | An optional payload to be sent with the event. |
-> SerfM Bool | Whether the event was successfully sent. |
Dispatch a custom user event into a Serf cluster.
Nodes in the cluster listen for these custom events and react to them.
sendEvent' :: SendOptions -> String -> Maybe String -> SerfM Bool Source
Dispatch a custom user event into a Serf cluster with additional flags set.
forceLeave :: String -> SerfM Bool Source
Force a specific node to leave a cluster. Note that the node will rejoin unless the serf agent for that node has exited.
:: String | The first node to join. |
-> [String] | Additional nodes to join. |
-> SerfM Bool | Whether joining all nodes was successful. |
Join the node to a cluster using the specified address(es).
At least one node address must be specified.
joinNodes' :: JoinOptions -> String -> [String] -> SerfM Bool Source
Join the node to a cluster with non-standard options.
members :: SerfM [MemberStatus] Source
List known members in the cluster
data MemberStatus Source
data LastKnownStatus Source
The last known status of listed nodes.
The minimum log level to log with the "monitor" command.
data MonitorOptions Source