distributed-process-extras-0.3.9: Cloud Haskell Extras
Safe HaskellNone
LanguageHaskell2010

Control.Distributed.Process.Extras.Internal.Types

Description

Types used throughout the Extras package

Synopsis

Tagging

type Tag = Int Source #

Tags provide uniqueness for messages, so that they can be matched with their response.

type TagPool = MVar Tag Source #

Generates unique Tag for messages and response pairs. Each process that depends, directly or indirectly, on the call mechanisms in Control.Distributed.Process.Global.Call should have at most one TagPool on which to draw unique message tags.

newTagPool :: Process TagPool Source #

Create a new per-process source of unique message identifiers.

getTag :: TagPool -> Process Tag Source #

Extract a new identifier from a TagPool.

Addressing

class Linkable a where Source #

Class of things to which a Process can link itself.

Minimal complete definition

Nothing

Methods

linkTo :: a -> Process () Source #

Create a link with the supplied object.

class Killable p where Source #

Class of things that can be killed (or instructed to exit).

Minimal complete definition

Nothing

Methods

killProc :: p -> String -> Process () Source #

Kill (instruct to exit) generic process, using kill primitive.

exitProc :: (Resolvable p, Serializable m) => p -> m -> Process () Source #

Kill (instruct to exit) generic process, using exit primitive.

Instances

Instances details
Resolvable p => Killable p Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Methods

killProc :: p -> String -> Process () Source #

exitProc :: (Resolvable p, Serializable m) => p -> m -> Process () Source #

class Routable a where Source #

Class of things that you can route/send serializable message to

Minimal complete definition

Nothing

Methods

sendTo :: (Serializable m, Resolvable a) => a -> m -> Process () Source #

Send a message to the target asynchronously

unsafeSendTo :: (NFSerializable m, Resolvable a) => a -> m -> Process () Source #

Send some NFData message to the target asynchronously, forcing evaluation (i.e., deepseq) beforehand.

Instances

Instances details
Routable ProcessId Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Routable Recipient Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Routable LogChan Source # 
Instance details

Defined in Control.Distributed.Process.Extras.SystemLog

Routable LogClient Source # 
Instance details

Defined in Control.Distributed.Process.Extras.SystemLog

Routable String Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Routable (NodeId, String) Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Routable (Message -> Process ()) Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Methods

sendTo :: (Serializable m, Resolvable (Message -> Process ())) => (Message -> Process ()) -> m -> Process () Source #

unsafeSendTo :: (NFSerializable m, Resolvable (Message -> Process ())) => (Message -> Process ()) -> m -> Process () Source #

class (Resolvable a, Routable a) => Addressable a Source #

Instances

Instances details
Addressable ProcessId Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

data Recipient Source #

A simple means of mapping to a receiver.

Instances

Instances details
Binary Recipient Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

NFData Recipient Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Methods

rnf :: Recipient -> () #

Resolvable Recipient Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Routable Recipient Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Generic Recipient Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Associated Types

type Rep Recipient 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

type Rep Recipient = D1 ('MetaData "Recipient" "Control.Distributed.Process.Extras.Internal.Types" "distributed-process-extras-0.3.9-7t7MELv3KbhCc2plSNlwpw" 'False) (C1 ('MetaCons "Pid" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ProcessId)) :+: (C1 ('MetaCons "Registered" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String)) :+: C1 ('MetaCons "RemoteRegistered" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NodeId))))
Show Recipient Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Eq Recipient Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

type Rep Recipient Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

type Rep Recipient = D1 ('MetaData "Recipient" "Control.Distributed.Process.Extras.Internal.Types" "distributed-process-extras-0.3.9-7t7MELv3KbhCc2plSNlwpw" 'False) (C1 ('MetaCons "Pid" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ProcessId)) :+: (C1 ('MetaCons "Registered" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String)) :+: C1 ('MetaCons "RemoteRegistered" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NodeId))))

data RegisterSelf Source #

Used internally in whereisOrStart. Sent as (RegisterSelf,ProcessId).

Constructors

RegisterSelf 

Instances

Instances details
Binary RegisterSelf Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

NFData RegisterSelf Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Methods

rnf :: RegisterSelf -> () #

Generic RegisterSelf Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Associated Types

type Rep RegisterSelf 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

type Rep RegisterSelf = D1 ('MetaData "RegisterSelf" "Control.Distributed.Process.Extras.Internal.Types" "distributed-process-extras-0.3.9-7t7MELv3KbhCc2plSNlwpw" 'False) (C1 ('MetaCons "RegisterSelf" 'PrefixI 'False) (U1 :: Type -> Type))
type Rep RegisterSelf Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

type Rep RegisterSelf = D1 ('MetaData "RegisterSelf" "Control.Distributed.Process.Extras.Internal.Types" "distributed-process-extras-0.3.9-7t7MELv3KbhCc2plSNlwpw" 'False) (C1 ('MetaCons "RegisterSelf" 'PrefixI 'False) (U1 :: Type -> Type))

Interactions

whereisRemote :: NodeId -> String -> Process (Maybe ProcessId) Source #

A synchronous version of whereis, this monitors the remote node and returns Nothing if the node goes down (since a remote node failing or being non-contactible has the same effect as a process not being registered from the caller's point of view).

resolveOrDie :: Resolvable a => a -> String -> Process ProcessId Source #

resolve the Resolvable or die with specified msg plus details of what didn't resolve

data CancelWait Source #

Wait cancellation message.

Constructors

CancelWait 

Instances

Instances details
Binary CancelWait Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

NFData CancelWait Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Methods

rnf :: CancelWait -> () #

Generic CancelWait Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Associated Types

type Rep CancelWait 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

type Rep CancelWait = D1 ('MetaData "CancelWait" "Control.Distributed.Process.Extras.Internal.Types" "distributed-process-extras-0.3.9-7t7MELv3KbhCc2plSNlwpw" 'False) (C1 ('MetaCons "CancelWait" 'PrefixI 'False) (U1 :: Type -> Type))
Show CancelWait Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Eq CancelWait Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

type Rep CancelWait Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

type Rep CancelWait = D1 ('MetaData "CancelWait" "Control.Distributed.Process.Extras.Internal.Types" "distributed-process-extras-0.3.9-7t7MELv3KbhCc2plSNlwpw" 'False) (C1 ('MetaCons "CancelWait" 'PrefixI 'False) (U1 :: Type -> Type))

type Channel a = (SendPort a, ReceivePort a) Source #

Simple representation of a channel.

data Shutdown Source #

A ubiquitous shutdown signal that can be used to maintain a consistent shutdown/stop protocol for any process that wishes to handle it.

Constructors

Shutdown 

Instances

Instances details
Binary Shutdown Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Methods

put :: Shutdown -> Put #

get :: Get Shutdown #

putList :: [Shutdown] -> Put #

NFData Shutdown Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Methods

rnf :: Shutdown -> () #

Generic Shutdown Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Associated Types

type Rep Shutdown 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

type Rep Shutdown = D1 ('MetaData "Shutdown" "Control.Distributed.Process.Extras.Internal.Types" "distributed-process-extras-0.3.9-7t7MELv3KbhCc2plSNlwpw" 'False) (C1 ('MetaCons "Shutdown" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Shutdown -> Rep Shutdown x #

to :: Rep Shutdown x -> Shutdown #

Show Shutdown Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Eq Shutdown Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

type Rep Shutdown Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

type Rep Shutdown = D1 ('MetaData "Shutdown" "Control.Distributed.Process.Extras.Internal.Types" "distributed-process-extras-0.3.9-7t7MELv3KbhCc2plSNlwpw" 'False) (C1 ('MetaCons "Shutdown" 'PrefixI 'False) (U1 :: Type -> Type))

data ExitReason Source #

Provides a reason for process termination.

Constructors

ExitNormal

indicates normal exit

ExitShutdown

normal response to a Shutdown

ExitOther !String

abnormal (error) shutdown

Instances

Instances details
Binary ExitReason Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

NFData ExitReason Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Methods

rnf :: ExitReason -> () #

Generic ExitReason Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Associated Types

type Rep ExitReason 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

type Rep ExitReason = D1 ('MetaData "ExitReason" "Control.Distributed.Process.Extras.Internal.Types" "distributed-process-extras-0.3.9-7t7MELv3KbhCc2plSNlwpw" 'False) (C1 ('MetaCons "ExitNormal" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ExitShutdown" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ExitOther" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String))))
Show ExitReason Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Eq ExitReason Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

type Rep ExitReason Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

type Rep ExitReason = D1 ('MetaData "ExitReason" "Control.Distributed.Process.Extras.Internal.Types" "distributed-process-extras-0.3.9-7t7MELv3KbhCc2plSNlwpw" 'False) (C1 ('MetaCons "ExitNormal" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ExitShutdown" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ExitOther" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 String))))

newtype ServerDisconnected Source #

Given when a server is unobtainable.

Instances

Instances details
Binary ServerDisconnected Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

NFData ServerDisconnected Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Methods

rnf :: ServerDisconnected -> () #

Generic ServerDisconnected Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

Associated Types

type Rep ServerDisconnected 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

type Rep ServerDisconnected = D1 ('MetaData "ServerDisconnected" "Control.Distributed.Process.Extras.Internal.Types" "distributed-process-extras-0.3.9-7t7MELv3KbhCc2plSNlwpw" 'True) (C1 ('MetaCons "ServerDisconnected" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DiedReason)))
type Rep ServerDisconnected Source # 
Instance details

Defined in Control.Distributed.Process.Extras.Internal.Types

type Rep ServerDisconnected = D1 ('MetaData "ServerDisconnected" "Control.Distributed.Process.Extras.Internal.Types" "distributed-process-extras-0.3.9-7t7MELv3KbhCc2plSNlwpw" 'True) (C1 ('MetaCons "ServerDisconnected" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DiedReason)))

class (NFData a, Serializable a) => NFSerializable a Source #

Introduces a class that brings NFData into scope along with Serializable, such that we can force evaluation. Intended for use with the UnsafePrimitives module (which wraps Control.Distributed.Process.UnsafePrimitives), and guarantees evaluatedness in terms of NFData. Please note that we cannot guarantee that an NFData instance will behave the same way as a Binary one with regards evaluation, so it is still possible to introduce unexpected behaviour by using unsafe primitives in this way.