serf-0.1.1.0: Interact with Serf via Haskell.

Safe HaskellSafe-Inferred
LanguageHaskell2010

System.Serf.Handler

Description

This module provides basic support for implementing Serf event handler programs using Haskell. Serf calls event handlers by executing the specified handler program with information relevant to the handler set in environment variables.

Synopsis

Documentation

data Event Source

A union of all possible event types that Serf supports.

Constructors

MemberJoin

An event indicating that members have joined the cluster.

MemberLeave

An event indicating that members have left the cluster.

MemberFailed

An event indicating that members have failed out of the cluster.

User String

A custom event triggered by an agent in the cluster.

Instances

data SerfEnv Source

All data set in the environment for the event handler. This is the primary way that Serf communicates relevant information to the executing handler.

Constructors

SerfEnv 

Fields

event :: Event

The event that caused the handling program to be executed.

selfName :: String

The name of the node that is executing the event handler.

selfRole :: String

The role of the node that is executing the event handler.

Instances

getSerfEnv :: IO (Maybe SerfEnv) Source

Retrieve all environment info set by Serf, returning Nothing if any Serf environment data is missing.