Have `spawnAsync` not use the transport in the local case.
commitf47c0859f812abb05cdec012e04c22dfe20f8f78
authorAlexander Vershilov <alexander.vershilov@gmail.com>
dateThu 18 Jun 2015, 16:27 (11 years ago)
parent07dbb9b
src/Control/Distributed/Process/Internal/Primitives.hs+4−1
@@ -986,7 +986,10 @@ expectTimeout n = receiveTimeout n [match return]
986986spawnAsync :: NodeId -> Closure (Process ()) -> Process SpawnRef
987987spawnAsync nid proc = do
988988 spawnRef <- getSpawnRef
989− sendCtrlMsg (Just nid) $ Spawn proc spawnRef
989+ node <- getSelfNode
990+ if nid == node
991+ then sendCtrlMsg Nothing $ Spawn proc spawnRef
992+ else sendCtrlMsg (Just nid) $ Spawn proc spawnRef
990993 return spawnRef
991994
992995-- | Monitor a node (asynchronous)