[rabbitmq-discuss] FW: Multiple consumers

Matthias Radestock matthias at lshift.net
Sat Jul 21 07:13:45 BST 2007


Ben,

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

>>  >>
>>  >>* The channel processes appear to be pointing to the same
>>  >>process for both reader and writer. That is useful for the
>>  >>common case of RPC-style interactions but you also need to
>>  >>support a subscription model along the lines of the Consumer
>>  >>classes in the Java client.
>>
>
> How about implementing a custom behaviour, spawning a new process and
> then passing this pid as this the writer?

A custom behaviour is probably overkill at this stage. The standard
gen_server or gen_event behaviour ought to be sufficient for now.

> BTW, why is it that a reader seems to write data and a writer seems to
> read data?

The reader reads data from the connection and writers write data to the
connection. If you were implementing a network client you'd have the
same roles/processes there and they'd be logically cross-wired, i.e. the
client reader would receive data from the server writers, and the client
writers would send data to the server reader. But since you are
bypassing the network and instead implement and interact with
server-side processes directly the roles appear reversed. This may get
tricky if you later want to bolt-on a networked mode.


Matthias.




More information about the rabbitmq-discuss mailing list