git.iko.soy/distributed-process
on master help sign in
Have nsendRemote skip the transport for local communication.
c67b972Facundo Domínguez
src/Control/Distributed/Process/Internal/Primitives.hs+4−2
@@ -1173,8 +1173,10 @@ unsafeNSend = Unsafe.nsend
1173
1173
1174-- | Named send to a process in a remote registry (asynchronous)
1174-- | Named send to a process in a remote registry (asynchronous)
1175nsendRemote :: Serializable a => NodeId -> String -> a -> Process ()
1175nsendRemote :: Serializable a => NodeId -> String -> a -> Process ()
1176−nsendRemote nid label msg =
1176+nsendRemote nid label msg = do
1177+ here <- getSelfNode
1178+ if here == nid then nsend label msg
1177− sendCtrlMsg (Just nid) (NamedSend label (createMessage msg))
1179+ else sendCtrlMsg (Just nid) (NamedSend label (createMessage msg))
1178
1180
1179--------------------------------------------------------------------------------
1181--------------------------------------------------------------------------------
1180-- Closures --
1182-- Closures --