git.iko.soy/distributed-process
on master help sign in
Merge pull request #186 from tweag/DP-97

Fix getNodeStats function, see DP-97

commitd87528c6c6e7cafbd3068983cbb17b48a61dd797 authorTim Watson <watson.timothy@gmail.com> dateSat 7 Mar 2015, 07:47 (12 years ago) parentc7fb15816fd0e2
1 file changed+4−4
src/Control/Distributed/Process/Internal/Primitives.hs+4−4
src/Control/Distributed/Process/Internal/Primitives.hs+4−4
@@ -757,11 +757,11 @@ getNodeStats nid = do
757757 selfNode <- getSelfNode
758758 if nid == selfNode
759759 then Right `fmap` getLocalNodeStats -- optimisation
760− else getNodeStatsRemote
760+ else getNodeStatsRemote selfNode
761761 where
762− getNodeStatsRemote :: Process (Either DiedReason NodeStats)
763− getNodeStatsRemote = do
764− sendCtrlMsg (Just nid) $ GetNodeStats nid
762+ getNodeStatsRemote :: NodeId -> Process (Either DiedReason NodeStats)
763+ getNodeStatsRemote selfNode = do
764+ sendCtrlMsg (Just nid) $ GetNodeStats selfNode
765765 bracket (monitorNode nid) unmonitor $ \mRef ->
766766 receiveWait [ match (\(stats :: NodeStats) -> return $ Right stats)
767767 , matchIf (\(NodeMonitorNotification ref _ _) -> ref == mRef)