acid-state-dist-0.1.0.0: Replication backend for acid-state

CopyrightMIT
Maintainermax.voit+hdv@with-eyes.net
Portabilitynon-portable (uses GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Data.Acid.Centered.Master

Description

The Master part of the Centered replication backend for acid state.

Synopsis

Documentation

openMasterState Source

Arguments

:: (IsAcidic st, Typeable st) 
=> String

address to bind (useful to listen on specific interfaces only)

-> PortNumber

port to bind to

-> st

initial state

-> IO (AcidState st) 

Open the Master state.

The directory for the local state files is the default one ("state[typeOf state]").

openMasterStateFrom Source

Arguments

:: (IsAcidic st, Typeable st) 
=> FilePath

location of the local state files

-> String

address to bind (useful to listen on specific interfaces only)

-> PortNumber

port to bind to

-> st

initial state

-> IO (AcidState st) 

Open the master state from a specific location.

openRedMasterState Source

Arguments

:: (IsAcidic st, Typeable st) 
=> String

address to bind (useful to listen on specific interfaces only)

-> PortNumber

port to bind to

-> Int

guarantee n-redundant replication

-> st

initial state

-> IO (AcidState st) 

Open the master state with n-redundant replication.

The directory for the local state files is the default one ("state/[typeOf state]/").

openRedMasterStateFrom Source

Arguments

:: (IsAcidic st, Typeable st) 
=> FilePath

location of the local state files

-> String

address to bind (useful to listen on specific interfaces only)

-> PortNumber

port to bind to

-> Int

guarantee n-redundant replication

-> st

initial state

-> IO (AcidState st) 

Open the master state from a specific location with redundant replication.

createArchiveGlobally :: (IsAcidic st, Typeable st) => AcidState st -> IO () Source

Create an archive on all nodes. Usually createArchive (local to each node) is appropriate. Also take care: Nodes that are not connected at the time, will not create an archive (on reconnect).

data MasterState st Source

Master state structure, for internal use.

Constructors

MasterState 

Fields

localState :: AcidState st
 
nodeStatus :: MVar NodeStatus
 
repRedundancy :: Int
 
repFinalizers :: MVar (IntMap (IO ()))
 
masterStateLock :: MVar ()
 
masterRevision :: MVar NodeRevision
 
masterRevisionN :: MVar NodeRevision
 
masterReplicationChan :: Chan ReplicationItem
 
masterReplicationChanN :: Chan ReplicationItem
 
masterReqThreadId :: MVar ThreadId
 
masterRepLThreadId :: MVar ThreadId
 
masterRepNThreadId :: MVar ThreadId
 
masterParentThreadId :: ThreadId
 
zmqContext :: Context
 
zmqAddr :: String
 
zmqSocket :: MVar (Socket Router)