File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/Control/Distributed/Process/Internal Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1103,8 +1103,10 @@ registerImpl force label pid = do
1103
1103
--
1104
1104
-- See comments in 'whereisRemoteAsync'
1105
1105
registerRemoteAsync :: NodeId -> String -> ProcessId -> Process ()
1106
- registerRemoteAsync nid label pid =
1107
- sendCtrlMsg (Just nid) (Register label nid (Just pid) False )
1106
+ registerRemoteAsync nid label pid = do
1107
+ here <- getSelfNode
1108
+ sendCtrlMsg (if nid == here then Nothing else Just nid)
1109
+ (Register label nid (Just pid) False )
1108
1110
1109
1111
reregisterRemoteAsync :: NodeId -> String -> ProcessId -> Process ()
1110
1112
reregisterRemoteAsync nid label pid =
@@ -1156,8 +1158,9 @@ whereis label = do
1156
1158
-- use 'monitorNode' and take appropriate action when you receive a
1157
1159
-- 'NodeMonitorNotification').
1158
1160
whereisRemoteAsync :: NodeId -> String -> Process ()
1159
- whereisRemoteAsync nid label =
1160
- sendCtrlMsg (Just nid) (WhereIs label)
1161
+ whereisRemoteAsync nid label = do
1162
+ here <- getSelfNode
1163
+ sendCtrlMsg (if nid == here then Nothing else Just nid) (WhereIs label)
1161
1164
1162
1165
-- | Named send to a process in the local registry (asynchronous)
1163
1166
nsend :: Serializable a => String -> a -> Process ()
You can’t perform that action at this time.
0 commit comments