serf-0.1.0.0: Interact with Serf via Haskell.

Safe HaskellNone

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."

www.serfdom.io/intro

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.

Synopsis

Documentation

type SerfM = Program SerfSource

An alias for the operational monad created with the Serf data type.

data Serf a whereSource

Commands supported by the serf executable (serf protocol v1).

class Monad m => MonadSerf m whereSource

A convenience class for lifting serf action evaluation into monad transformer stacks.

Methods

evalSerf :: SerfM a -> m aSource

Evaluate the specified serf actions in given context

serf :: SerfM a -> IO aSource

Run serf actions locally on the default port.

serfAt :: String -> SerfM a -> IO aSource

Run serf actions at a specified RPC address.

serfWithOpts :: [String] -> SerfM a -> IO aSource

Run serf actions with a list of arbitrary command line arguments.

sendEventSource

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 BoolSource

Dispatch a custom user event into a Serf cluster with additional flags set.

forceLeave :: String -> SerfM BoolSource

Force a specific node to leave a cluster. Note that the node will rejoin unless the serf agent for that node has exited.

joinNodesSource

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 BoolSource

Join the node to a cluster with non-standard options.

data JoinOptions Source

Options specific to joining a cluster

Constructors

JoinOptions 

Fields

_jsReplay :: Maybe Bool

Whether to replay all events that have occurred in the cluster.

members :: SerfM [MemberStatus]Source

List known members in the cluster

data LastKnownStatus Source

The last known status of listed nodes.

Constructors

Alive 
Failed 

data LogLevel Source

The minimum log level to log with the monitor command.

Constructors

Trace 
Debug 
Info 
Warn 
Error 

data MonitorOptions Source

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.