git.iko.soy/distributed-process
on master help sign in
Have nsendRemote skip the transport for local communication.
commitc67b972d7589130a231487584925af868626031d authorFacundo Domínguez <facundo.dominguez@tweag.io> dateFri 27 Nov 2015, 14:49 (11 years ago) parentdeadc44
1 file changed+4−2
src/Control/Distributed/Process/Internal/Primitives.hs+4−2
src/Control/Distributed/Process/Internal/Primitives.hs+4−2
@@ -1173,8 +1173,10 @@ unsafeNSend = Unsafe.nsend
11731173
11741174-- | Named send to a process in a remote registry (asynchronous)
11751175nsendRemote :: Serializable a => NodeId -> String -> a -> Process ()
1176−nsendRemote nid label msg =
1177− sendCtrlMsg (Just nid) (NamedSend label (createMessage msg))
1176+nsendRemote nid label msg = do
1177+ here <- getSelfNode
1178+ if here == nid then nsend label msg
1179+ else sendCtrlMsg (Just nid) (NamedSend label (createMessage msg))
11781180
11791181--------------------------------------------------------------------------------
11801182-- Closures --