[rabbitmq-discuss] FW: Multiple consumers

Matthias Radestock matthias at lshift.net
Sun Jul 29 14:01:42 BST 2007


Ben,

"Ben Hood" <0x6e6562 at gmail.com> writes:

> I do have a couple of questions about this though:
>
> 1. In the direct case, the host and channel would be set in the
> start() call, so just passing the Pid is fine.

There is no 'host' in the direct case.

> In the network case, you would only start one client process, so you
> would still have to pass in the channel number as an integer for the
> client process to differentiate. Or would you somehow initialize a
> socket connection and then pass this to a process that you spawn per
> channel?

The initialisation sequence for the networked client is:

1) open socket,

2) spawn reader process, parameterised by the socket.

3) open channels by sending a message to the reader process. This should
result in the spawning a new channel process, parameterised by the
channel number, ReaderPid and WriterPid, and the necessary book-keeping
(mapping channel numbers to pids) - i.e. everything
rabbit_reader:open_channel does currently. The reply message to the
sender of the 'open_channel' message should contain the Pid of the new
channel process.

> 2. Should the processes be linked at all? That is, if a channel
> process dies, should the user process die as well?

Channel processes should be (and are) linked to their reader process. As
for linking them to the user process, i.e. the process that initiated
the opening of a channel, I reckon we should leave that up to the user.


Matthias.




More information about the rabbitmq-discuss mailing list