serf-0.1.1.0: Interact with Serf via Haskell.

Safe HaskellNone
LanguageHaskell2010

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 Serf #

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

data Serf a where #

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

class Monad m => MonadSerf m where #

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

Minimal complete definition

evalSerf

Methods

evalSerf :: SerfM a -> m a #

Evaluate the specified serf actions in given context

serf :: SerfM a -> IO a #

Run serf actions locally on the default port.

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

Run serf actions at a specified RPC address.

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

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

sendEvent #

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 

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.

joinNodes #

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.

data JoinOptions #

Options specific to joining a cluster

Constructors

JoinOptions 

Fields

members :: SerfM [MemberStatus] #

List known members in the cluster

data LogLevel #

The minimum log level to log with the "monitor" command.

Constructors

Trace 
Debug 
Info 
Warn 
Error 

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.