diff --git a/src/Control/Distributed/Process/Backend/SimpleLocalnet.hs b/src/Control/Distributed/Process/Backend/SimpleLocalnet.hs index 6c69a38..58f9157 100644 --- a/src/Control/Distributed/Process/Backend/SimpleLocalnet.hs +++ b/src/Control/Distributed/Process/Backend/SimpleLocalnet.hs @@ -360,9 +360,14 @@ findSlaves backend = do -- Wait for the replies catMaybes <$> replicateM (length nodes) ( receiveWait - [ match (\(WhereIsReply "slaveController" mPid) -> return mPid) + [ match handleWhereIsReply , match (\(NodeMonitorNotification {}) -> return Nothing) ]) + where + handleWhereIsReply :: WhereIsReply -> Process (Maybe ProcessId) + handleWhereIsReply (WhereIsReply name mPid) + | name == "slaveController" = return mPid + | otherwise = return Nothing -- | Terminate all slaves terminateAllSlaves :: Backend -> Process ()