git.iko.soy/distributed-process
on master help sign in
Remove whereisAsync
ccab66cEdsko de Vries
distributed-process/src/Control/Distributed/Process/Internal/Primitives.hs+7−11
@@ -490,19 +490,15 @@ whereis label = do
490 (\(WhereIsReply _ mPid) -> return mPid)
490 (\(WhereIsReply _ mPid) -> return mPid)
491 ]
491 ]
492
492
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−
503-- | Query a remote process registry (asynchronous)
493-- | Query a remote process registry (asynchronous)
504--
494--
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').
506whereisRemoteAsync :: NodeId -> String -> Process ()
502whereisRemoteAsync :: NodeId -> String -> Process ()
507whereisRemoteAsync nid label =
503whereisRemoteAsync nid label =
508 sendCtrlMsg (Just nid) (WhereIs label)
504 sendCtrlMsg (Just nid) (WhereIs label)