git.iko.soy/distributed-process
on master help sign in
Remove whereisAsync
commitccab66cb7d0e70472d69125a06753908745212cd authorEdsko de Vries <edsko@edsko.net> dateThu 23 Aug 2012, 13:45 (14 years ago) parent65b2798
1 file changed+7−11
distributed-process/src/Control/Distributed/Process/Internal/Primitives.hs+7−11
distributed-process/src/Control/Distributed/Process/Internal/Primitives.hs+7−11
@@ -490,19 +490,15 @@ whereis label = do
490490 (\(WhereIsReply _ mPid) -> return mPid)
491491 ]
492492
493−-- | Query a remote process registry (synchronous)
494−--
495−-- TODO: what if the remote node is unreachable?
496−whereisRemote :: NodeId -> String -> Process (Maybe ProcessId)
497−whereisRemote nid label = do
498− whereisRemoteAsync nid label
499− receiveWait [ matchIf (\(WhereIsReply label' _) -> label == label')
500− (\(WhereIsReply _ mPid) -> return mPid)
501− ]
502−
503493-- | Query a remote process registry (asynchronous)
504494--
505−-- Reply will come in the form of a 'WhereIsReply' message
495+-- Reply will come in the form of a 'WhereIsReply' message.
496+--
497+-- There is currently no synchronous version of 'whereisRemoteAsync': if
498+-- you implement one yourself, be sure to take into account that the remote
499+-- node might die or get disconnect before it can respond (i.e. you should
500+-- use 'monitorNode' and take appropriate action when you receive a
501+-- 'NodeMonitorNotification').
506502whereisRemoteAsync :: NodeId -> String -> Process ()
507503whereisRemoteAsync nid label =
508504 sendCtrlMsg (Just nid) (WhereIs label)