Safe Haskell | None |
---|---|
Language | Haskell2010 |
System.Serf
Description
"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).
Constructors
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 #
A convenience class for lifting serf action evaluation into monad transformer stacks.
Minimal complete definition
serfWithOpts :: [String] -> SerfM a -> IO a #
Run serf actions with a list of arbitrary command line arguments.
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 #
Dispatch a custom user event into a Serf cluster with additional flags set.
data SendOptions #
Constructors
SendOptions | |
Fields |
forceLeave :: String -> SerfM Bool #
Force a specific node to leave a cluster. Note that the node will rejoin unless the serf agent for that node has exited.
Arguments
:: 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 #
Join the node to a cluster with non-standard options.
members :: SerfM [MemberStatus] #
List known members in the cluster
The minimum log level to log with the "monitor" command.
data MonitorOptions #
Options for monitoring serf agent events. It is recommended that the log level is cranked up to either Warn or Error, as the default currently seems to be Debug, and is not generally useful in production environments.
Constructors
MonitorOptions | |
Fields |