git.iko.soy/distributed-process
on master help sign in
actually hide ProcessKillException - we do not want anyone to be able
8d4eeb2Tim Watson
distributed-process/src/Control/Distributed/Process/Internal/Primitives.hs−11
@@ -26,7 +26,6 @@ module Control.Distributed.Process.Internal.Primitives
26 , terminate
26 , terminate
27 , ProcessTerminationException(..)
27 , ProcessTerminationException(..)
28 , kill
28 , kill
29− , ProcessKillException(..)
30 , exit
29 , exit
31 , catchExit
30 , catchExit
32 , ProcessExitException(..)
31 , ProcessExitException(..)
@@ -355,16 +354,6 @@ kill :: ProcessId -> String -> Process ()
355-- 'monitor' or 'link' request.
354-- 'monitor' or 'link' request.
356kill them reason = sendCtrlMsg Nothing (Kill them reason)
355kill them reason = sendCtrlMsg Nothing (Kill them reason)
357
356
358−-- | Thrown by 'kill'
359−data ProcessKillException =
360− ProcessKillException !ProcessId !String
361− deriving (Typeable)
362−
363−instance Exception ProcessKillException
364−instance Show ProcessKillException where
365− show (ProcessKillException pid reason) =
366− "killed-by=" ++ show pid ++ ",reason=" ++ reason
367−
368-- | Graceful request to exit a process
357-- | Graceful request to exit a process
369exit :: Serializable a => ProcessId -> a -> Process ()
358exit :: Serializable a => ProcessId -> a -> Process ()
370-- NOTE: We send the message to our local node controller, which will then
359-- NOTE: We send the message to our local node controller, which will then
distributed-process/src/Control/Distributed/Process/Node.hs+11−1
@@ -152,7 +152,6 @@ import Control.Distributed.Process.Internal.Primitives
152 , receiveWait
152 , receiveWait
153 , match
153 , match
154 , sendChan
154 , sendChan
155− , ProcessKillException(..)
156 , ProcessExitException(..)
155 , ProcessExitException(..)
157 )
156 )
158import Control.Distributed.Process.Internal.Types
157import Control.Distributed.Process.Internal.Types
@@ -481,6 +480,17 @@ initNCState = NCState { _links = Map.empty
481 , _registeredOnNodes = Map.empty
480 , _registeredOnNodes = Map.empty
482 }
481 }
483
482
483+-- | Thrown in response to the user invoking 'kill' (see Primitives.hs). This
484+-- type is deliberately not exported so it cannot be caught explicitly.
485+data ProcessKillException =
486+ ProcessKillException !ProcessId !String
487+ deriving (Typeable)
488+
489+instance Exception ProcessKillException
490+instance Show ProcessKillException where
491+ show (ProcessKillException pid reason) =
492+ "killed-by=" ++ show pid ++ ",reason=" ++ reason
493+
484--------------------------------------------------------------------------------
494--------------------------------------------------------------------------------
485-- Core functionality --
495-- Core functionality --
486--------------------------------------------------------------------------------
496--------------------------------------------------------------------------------