Safe Haskell | None |
---|---|
Language | Haskell98 |
Types used throughout the Extras package
- type Tag = Int
- type TagPool = MVar Tag
- newTagPool :: Process TagPool
- getTag :: TagPool -> Process Tag
- class Linkable a where
- class Killable a where
- class Resolvable a where
- class Routable a where
- sendTo :: Serializable m => a -> m -> Process ()
- unsafeSendTo :: NFSerializable m => a -> m -> Process ()
- unresolvableMessage :: a -> String
- class (Resolvable a, Routable a) => Addressable a
- sendToRecipient :: Serializable m => Recipient -> m -> Process ()
- data Recipient
- = Pid !ProcessId
- | Registered !String
- | RemoteRegistered !String !NodeId
- data RegisterSelf = RegisterSelf
- whereisRemote :: NodeId -> String -> Process (Maybe ProcessId)
- resolveOrDie :: (Routable a, Resolvable a) => a -> String -> Process ProcessId
- data CancelWait = CancelWait
- type Channel a = (SendPort a, ReceivePort a)
- data Shutdown = Shutdown
- data ExitReason
- data ServerDisconnected = ServerDisconnected !DiedReason
- class (NFData a, Serializable a) => NFSerializable a
- __remoteTable :: RemoteTable -> RemoteTable
Tagging
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.
Addressing
Class of things to which a Process
can link itself.
Class of things that can be killed (or instructed to exit).
class Resolvable a where Source
Class of things that can be resolved to a ProcessId
.
Provides a unified API for addressing processes.
sendTo :: Serializable m => a -> m -> Process () Source
Send a message to the target asynchronously
unsafeSendTo :: NFSerializable m => a -> m -> Process () Source
Send some NFData
message to the target asynchronously,
forcing evaluation (i.e., deepseq
) beforehand.
unresolvableMessage :: a -> String Source
Unresolvable Addressable
Message
class (Resolvable a, Routable a) => Addressable a Source
(Resolvable a, Routable a) => Addressable a Source |
sendToRecipient :: Serializable m => Recipient -> m -> Process () Source
A simple means of mapping to a receiver.
data RegisterSelf Source
Used internally in whereisOrStart. Sent as (RegisterSelf,ProcessId).
Interactions
resolveOrDie :: (Routable a, 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.
type Channel a = (SendPort a, ReceivePort a) Source
Simple representation of a channel.
A ubiquitous shutdown signal that can be used to maintain a consistent shutdown/stop protocol for any process that wishes to handle it.
data ExitReason Source
Provides a reason for process termination.
ExitNormal | indicates normal exit |
ExitShutdown | normal response to a |
ExitOther !String | abnormal (error) shutdown |
data ServerDisconnected Source
Given when a server is unobtainable.
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.
(NFData a, Serializable a) => NFSerializable a Source |