git.iko.soy/distributed-process
on master help sign in
Merge branch 'master' of git://github.com/haskell-distributed/distributed-process
commit7a402418a52d098ec90c89455c06c3feff740fd6 authorTim Watson <watson.timothy@gmail.com> dateSun 7 Dec 2014, 19:16 (12 years ago) parentb3037d8020d157
4 files changed+22−8
src/Control/Distributed/Process/Closure.hs+4 src/Control/Distributed/Process/Internal/Closure/BuiltIn.hs+11 src/Control/Distributed/Process/Internal/Primitives.hs+3−5 src/Control/Distributed/Process/Internal/Types.hs+4−3
src/Control/Distributed/Process/Closure.hs+4
@@ -163,6 +163,8 @@ module Control.Distributed.Process.Closure
163163 , sdictUnit
164164 , sdictProcessId
165165 , sdictSendPort
166+ , sdictStatic
167+ , sdictClosure
166168 -- * The CP type and associated combinators
167169 , CP
168170 , idCP
@@ -203,6 +205,8 @@ import Control.Distributed.Process.Internal.Closure.BuiltIn
203205 , sdictUnit
204206 , sdictProcessId
205207 , sdictSendPort
208+ , sdictStatic
209+ , sdictClosure
206210 -- The CP type and associated combinators
207211 , CP
208212 , idCP
src/Control/Distributed/Process/Internal/Closure/BuiltIn.hs+11
@@ -8,6 +8,8 @@ module Control.Distributed.Process.Internal.Closure.BuiltIn
88 , sdictUnit
99 , sdictProcessId
1010 , sdictSendPort
11+ , sdictStatic
12+ , sdictClosure
1113 -- * Some static values
1214 , sndStatic
1315 -- * The CP type and associated combinators
@@ -82,6 +84,7 @@ remoteTable =
8284 . registerStatic "$sdictUnit" (toDynamic (SerializableDict :: SerializableDict ()))
8385 . registerStatic "$sdictProcessId" (toDynamic (SerializableDict :: SerializableDict ProcessId))
8486 . registerStatic "$sdictSendPort_" (toDynamic (sdictSendPort_ :: SerializableDict ANY -> SerializableDict (SendPort ANY)))
87+ . registerStatic "$sdictClosure" (toDynamic (SerializableDict :: SerializableDict (Closure ANY)))
8588 . registerStatic "$returnProcess" (toDynamic (return :: ANY -> Process ANY))
8689 . registerStatic "$seqProcess" (toDynamic ((>>) :: Process ANY1 -> Process ANY2 -> Process ANY2))
8790 . registerStatic "$bindProcess" (toDynamic ((>>=) :: Process ANY1 -> (ANY1 -> Process ANY2) -> Process ANY2))
@@ -144,6 +147,14 @@ sdictSendPort :: Typeable a
144147 => Static (SerializableDict a) -> Static (SerializableDict (SendPort a))
145148sdictSendPort = staticApply (staticLabel "$sdictSendPort_")
146149
150+-- | Serialization dictionary for 'Static'.
151+sdictStatic :: Typeable a => Static (SerializableDict (Static a))
152+sdictStatic = staticLabel "$sdictStatic"
153+
154+-- | Serialization dictionary for 'Closure'.
155+sdictClosure :: Typeable a => Static (SerializableDict (Closure a))
156+sdictClosure = staticLabel "$sdictClosure"
157+
147158--------------------------------------------------------------------------------
148159-- Static values --
149160--------------------------------------------------------------------------------
src/Control/Distributed/Process/Internal/Primitives.hs+3−5
@@ -1025,11 +1025,9 @@ say string = do
10251025-- Registry --
10261026--------------------------------------------------------------------------------
10271027
1028−-- | Register a process with the local registry (asynchronous).
1029−-- This version will wait until a response is gotten from the
1030−-- management process. The name must not already be registered.
1031−-- The process need not be on this node.
1032−-- A bad registration will result in a 'ProcessRegistrationException'
1028+-- | Register a process with the local registry (synchronous). The name must not
1029+-- already be registered. The process need not be on this node. A bad
1030+-- registration will result in a 'ProcessRegistrationException'
10331031--
10341032-- The process to be registered does not have to be local itself.
10351033register :: String -> ProcessId -> Process ()
src/Control/Distributed/Process/Internal/Types.hs+4−3
@@ -86,6 +86,7 @@ module Control.Distributed.Process.Internal.Types
8686import System.Mem.Weak (Weak)
8787import Data.Map (Map)
8888import Data.Int (Int32)
89+import Data.Data (Data)
8990import Data.Typeable (Typeable, typeOf)
9091import Data.Binary (Binary(put, get), putWord8, getWord8, encode)
9192import qualified Data.ByteString as BSS (ByteString, concat, copy)
@@ -133,7 +134,7 @@ import GHC.Generics
133134
134135-- | Node identifier
135136newtype NodeId = NodeId { nodeAddress :: NT.EndPointAddress }
136− deriving (Eq, Ord, Typeable, Generic)
137+ deriving (Eq, Ord, Typeable, Data, Generic)
137138instance Binary NodeId where
138139instance NFData NodeId
139140instance Hashable NodeId where
@@ -146,7 +147,7 @@ data LocalProcessId = LocalProcessId
146147 { lpidUnique :: {-# UNPACK #-} !Int32
147148 , lpidCounter :: {-# UNPACK #-} !Int32
148149 }
149− deriving (Eq, Ord, Typeable, Generic, Show)
150+ deriving (Eq, Ord, Typeable, Data, Generic, Show)
150151
151152instance Hashable LocalProcessId where
152153
@@ -157,7 +158,7 @@ data ProcessId = ProcessId
157158 -- | Node-local identifier for the process
158159 , processLocalId :: {-# UNPACK #-} !LocalProcessId
159160 }
160− deriving (Eq, Ord, Typeable, Generic)
161+ deriving (Eq, Ord, Typeable, Data, Generic)
161162
162163instance Binary ProcessId where
163164instance NFData ProcessId where