[rabbitmq-discuss] Question about rabbit_reader.erl

Ben Hood 0x6e6562 at gmail.com
Thu Sep 10 20:21:07 BST 2009


On Thu, Sep 10, 2009 at 5:00 PM, Erik Rigtorp<erik at rigtorp.com> wrote:
> I'm curious about why prim_inet:async_recv() is being used instead of
> active mode. I'm writing a software in erlang that requires low
> latency networking and I'm having trouble with very high latencies of
> 400ms+ between the nic and my erlang process. Maybe using
> prim_inet:async_recv() has some advantages latency wise?

I don't know about what effect an async_recv has on latency (sounds
like a erlang-questions question), but one nice property of it is that
you can receive the socket data from your mailbox - which allows you
to loop on the mailbox and potentially pick up messages from processes
other than the one reading from the socket. If you were to do a
synchronous receive, you couldn't interleave control messages as
elegantly as with this method.


More information about the rabbitmq-discuss mailing list