@@ -27,6 +27,8 @@ module Control.Distributed.Process.Platform.Supervisor.Types
27
27
, Child
28
28
, StaticLabel
29
29
, SupervisorPid
30
+ , ChildPid
31
+ , StarterPid
30
32
-- * Limits and Defaults
31
33
, MaxRestarts (.. )
32
34
, maxRestarts
@@ -64,6 +66,10 @@ import Control.Distributed.Process.Platform.Time
64
66
import Control.Distributed.Process.Platform.Internal.Primitives hiding (monitor )
65
67
import Control.Exception (Exception )
66
68
69
+ -- aliases for api documentation purposes
70
+ type SupervisorPid = ProcessId
71
+ type ChildPid = ProcessId
72
+ type StarterPid = ProcessId
67
73
68
74
newtype MaxRestarts = MaxR { maxNumberOfRestarts :: Int }
69
75
deriving (Typeable , Generic , Show )
@@ -184,9 +190,9 @@ type ChildKey = String
184
190
185
191
-- | A reference to a (possibly running) child.
186
192
data ChildRef =
187
- ChildRunning ! ProcessId -- ^ a reference to the (currently running) child
188
- | ChildRunningExtra ! ProcessId ! Message -- ^ also a currently running child, with /extra/ child info
189
- | ChildRestarting ! ProcessId -- ^ a reference to the /old/ (previous) child (now restarting)
193
+ ChildRunning ! ChildPid -- ^ a reference to the (currently running) child
194
+ | ChildRunningExtra ! ChildPid ! Message -- ^ also a currently running child, with /extra/ child info
195
+ | ChildRestarting ! ChildPid -- ^ a reference to the /old/ (previous) child (now restarting)
190
196
| ChildStopped -- ^ indicates the child is not currently running
191
197
| ChildStartIgnored -- ^ a non-temporary child exited with 'ChildInitIgnore'
192
198
deriving (Typeable , Generic , Show )
@@ -250,7 +256,7 @@ instance NFData ChildTerminationPolicy where
250
256
data RegisteredName =
251
257
LocalName ! String
252
258
| GlobalName ! String
253
- | CustomRegister ! (Closure (ProcessId -> Process () ))
259
+ | CustomRegister ! (Closure (ChildPid -> Process () ))
254
260
deriving (Typeable , Generic )
255
261
instance Binary RegisteredName where
256
262
instance NFData RegisteredName where
@@ -262,8 +268,8 @@ instance Show RegisteredName where
262
268
263
269
data ChildStart =
264
270
RunClosure ! (Closure (Process () ))
265
- | CreateHandle ! (Closure (SupervisorPid -> Process (ProcessId , Message )))
266
- | StarterProcess ! ProcessId
271
+ | CreateHandle ! (Closure (SupervisorPid -> Process (ChildPid , Message )))
272
+ | StarterProcess ! StarterPid
267
273
deriving (Typeable , Generic , Show )
268
274
instance Binary ChildStart where
269
275
instance NFData ChildStart where
@@ -327,7 +333,6 @@ instance Binary DeleteChildResult where
327
333
instance NFData DeleteChildResult where
328
334
329
335
type Child = (ChildRef , ChildSpec )
330
- type SupervisorPid = ProcessId
331
336
332
337
-- exported result types of internal APIs
333
338
0 commit comments