git.iko.soy/distributed-process
on master help sign in
Fix getNodeStats function, see DP-97
commit16fd0e268a17985c678a16bcd05a59f9484e8ba6 authorAlexander Vershilov <alexander.vershilov@gmail.com> dateMon 2 Mar 2015, 23:01 (12 years ago) parent4d3472a
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)