Named send is intra-node, so we can use the optimised routing / encoding
commit9f10533cc0edd741f6472157d581d4b8e9e0bf2c
authorTim Watson <tim@rabbitmq.com>
dateFri 26 Apr 2013, 23:49 (13 years ago)
parentfb58b07
src/Control/Distributed/Process/Internal/Primitives.hs+1−1
@@ -924,7 +924,7 @@ whereisRemoteAsync nid label =
924924-- | Named send to a process in the local registry (asynchronous)
925925nsend :: Serializable a => String -> a -> Process ()
926926nsend label msg =
927− sendCtrlMsg Nothing (NamedSend label (createMessage msg))
927+ sendCtrlMsg Nothing (NamedSend label (createUnencodedMessage msg))
928928
929929-- | Named send to a process in a remote registry (asynchronous)
930930nsendRemote :: Serializable a => NodeId -> String -> a -> Process ()
src/Control/Distributed/Process/Node.hs+1−6
@@ -812,12 +812,7 @@ ncEffectNamedSend from label msg = do
812812 node <- ask
813813 mPid <- gets (^. registeredHereFor label)
814814 -- If mPid is Nothing, we just ignore the named send (as per Table 14)
815− forM_ mPid $ \pid ->
816− liftIO $ sendPayload node
817− from
818− (ProcessIdentifier pid)
819− NoImplicitReconnect
820− (messageToPayload msg)
815+ forM_ mPid $ \pid -> postMessage pid msg
821816
822817-- [Issue #DP-20]
823818ncEffectLocalSend :: ProcessId -> Message -> NC ()