Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #186 from tweag/DP-97

Fix getNodeStats function, see DP-97
commit d87528c6c6e7cafbd3068983cbb17b48a61dd797 2 parents c7fb158 + 16fd0e2
@hyperthunk hyperthunk authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/Control/Distributed/Process/Internal/Primitives.hs
View
8 src/Control/Distributed/Process/Internal/Primitives.hs
@@ -757,11 +757,11 @@ getNodeStats nid = do
selfNode <- getSelfNode
if nid == selfNode
then Right `fmap` getLocalNodeStats -- optimisation
- else getNodeStatsRemote
+ else getNodeStatsRemote selfNode
where
- getNodeStatsRemote :: Process (Either DiedReason NodeStats)
- getNodeStatsRemote = do
- sendCtrlMsg (Just nid) $ GetNodeStats nid
+ getNodeStatsRemote :: NodeId -> Process (Either DiedReason NodeStats)
+ getNodeStatsRemote selfNode = do
+ sendCtrlMsg (Just nid) $ GetNodeStats selfNode
bracket (monitorNode nid) unmonitor $ \mRef ->
receiveWait [ match (\(stats :: NodeStats) -> return $ Right stats)
, matchIf (\(NodeMonitorNotification ref _ _) -> ref == mRef)
Please sign in to comment.
Something went wrong with that request. Please try again.