git.iko.soy/distributed-process
on master help sign in
Change withMonitor api.
077aecbAlexander Vershilov
src/Control/Distributed/Process/Internal/Primitives.hs+3−4
@@ -887,9 +887,8 @@ monitor = monitor' . ProcessIdentifier
887-- @withMonitor@ returns, there might still be unreceived monitor
887-- @withMonitor@ returns, there might still be unreceived monitor
888-- messages in the queue.
888-- messages in the queue.
889--
889--
890−withMonitor :: ProcessId -> Process a -> Process a
890+withMonitor :: ProcessId -> (MonitorRef -> Process a) -> Process a
891−withMonitor pid = bracket (monitor pid) unmonitor . const
891+withMonitor pid = bracket (monitor pid) unmonitor
892−{-# WARNING withMonitor "Signature of this function will be changed to 'ProcessId -> (MonitorRef -> Process a) -> Process a' in the next release, for stable behaviour use withMonitor_" #-}
893
892
894-- | Establishes temporary monitoring of another process.
893-- | Establishes temporary monitoring of another process.
895--
894--
@@ -900,7 +899,7 @@ withMonitor pid = bracket (monitor pid) unmonitor . const
900--
899--
901-- Since 0.6.1
900-- Since 0.6.1
902withMonitor_ :: ProcessId -> Process a -> Process a
901withMonitor_ :: ProcessId -> Process a -> Process a
903−withMonitor_ = withMonitor
902+withMonitor_ p = withMonitor p . const
904
903
905-- | Remove a link
904-- | Remove a link
906--
905--