[rabbitmq-discuss] multiple direct Erlang clients

Ben Hood 0x6e6562 at gmail.com
Mon Aug 3 21:26:06 BST 2009


On Mon, Aug 3, 2009 at 2:26 PM, Ben Browitt<ben.browitt at gmail.com> wrote:
> In amqp_channel the cast function is defined as:
> cast(Channel, Method) ->
>     gen_server:cast(Channel, {cast, Method}).
> When using a large number of direct Erlang clients for a gateway
> implementation
> where every outer client using some protocol has an Erlang client acting as
> a translator,
> wouldn't this design create a block at amqp_channel:cast/2 and slow things
> down?
> Shouldn't the client call gen_server:cast/2 directly instead of calling
> amqp_channel:cast/2
> and use the fact that each Erlang client is a process?

Sorry, I don't quite follow.

amqp_channel is a gen_server instance and as such, you generally use
gen_server:cast/2 to send messages to it (although you could construct
the message yourself). amqp_channel:cast/2 merely hides this fact from
the consumer of the API.

Or did you mean that the cost of invoking the gen_server function is a
cause for concern (in the sense that the runtime would need to perform
a double resolution in order to figure out where to dispatch the call

Or do mean that using the gen_server abstraction for each channel is
going to be a performance concern for you?



More information about the rabbitmq-discuss mailing list