Skip to content

Commit 78ef646

Browse files
Use usend to implement spawn. (haskell-distributed#297)
This avoids the need to create a connection from the spawner to the spawned process when spawning.
1 parent 1d099cc commit 78ef646

File tree

1 file changed

+3
-3
lines changed
  • src/Control/Distributed/Process/Internal

1 file changed

+3
-3
lines changed

src/Control/Distributed/Process/Internal/Spawn.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import Control.Distributed.Process.Internal.Closure.BuiltIn
4343
)
4444
import Control.Distributed.Process.Internal.Primitives
4545
( -- Basic messaging
46-
send
46+
usend
4747
, expect
4848
, receiveWait
4949
, match
@@ -71,7 +71,7 @@ spawn nid proc = do
7171
receiveWait [
7272
matchIf (\(DidSpawn ref _) -> ref == sRef) $ \(DidSpawn _ pid) -> do
7373
unmonitor mRef
74-
send pid ()
74+
usend pid ()
7575
return pid
7676
, matchIf (\(NodeMonitorNotification ref _ _) -> ref == mRef) $ \_ ->
7777
return (nullProcessId nid)
@@ -118,7 +118,7 @@ call dict nid proc = do
118118
cpDelayed us (returnCP sdictUnit ())
119119
)
120120
mResult <- receiveWait
121-
[ match $ \a -> send pid () >> return (Right a)
121+
[ match $ \a -> usend pid () >> return (Right a)
122122
, matchIf (\(ProcessMonitorNotification ref _ _) -> ref == mRef)
123123
(\(ProcessMonitorNotification _ _ reason) -> return (Left reason))
124124
]

0 commit comments

Comments
 (0)