git.iko.soy/distributed-process
on master help sign in
Change withMonitor api.

Api of withMonitor function is changed to: withMonitor :: Process a -> (MonitorRef -> Process a) -> Process a This way it's possible to pass currently allocated monitor to the user function.

commit077aecb268b31a7c453a1eb3492e383e5cffe1db authorAlexander Vershilov <alexander.vershilov@gmail.com> dateTue 22 Mar 2016, 18:33 (11 years ago) parent6c04653
1 file changed+3−4
src/Control/Distributed/Process/Internal/Primitives.hs+3−4
src/Control/Distributed/Process/Internal/Primitives.hs+3−4
@@ -887,9 +887,8 @@ monitor = monitor' . ProcessIdentifier
887887-- @withMonitor@ returns, there might still be unreceived monitor
888888-- messages in the queue.
889889--
890−withMonitor :: ProcessId -> Process a -> Process a
891−withMonitor pid = bracket (monitor pid) unmonitor . const
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_" #-}
890+withMonitor :: ProcessId -> (MonitorRef -> Process a) -> Process a
891+withMonitor pid = bracket (monitor pid) unmonitor
893892
894893-- | Establishes temporary monitoring of another process.
895894--
@@ -900,7 +899,7 @@ withMonitor pid = bracket (monitor pid) unmonitor . const
900899--
901900-- Since 0.6.1
902901withMonitor_ :: ProcessId -> Process a -> Process a
903−withMonitor_ = withMonitor
902+withMonitor_ p = withMonitor p . const
904903
905904-- | Remove a link
906905--