[rabbitmq-discuss] FW: Multiple consumers
Ben Hood
0x6e6562 at gmail.com
Sat Jul 21 17:10:55 BST 2007
> A custom behaviour is probably overkill at this stage. The standard
> gen_server or gen_event behaviour ought to be sufficient for now.
Yes, you're right, I'll take look to see if the gen_event behaviour
will do the trick.
>
> > 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.
>
OK, that makes sense, I'll bear this in mind. Going back to the
orginal problem of setting the correct writer pid, I think I can add a
writer_pid field the the connection record, so that the client can
start a process to handle the subscription (e.g. by passing the Pid of
a gen_event event manager) and pass the Pid to the channel loop.
In general though (i.e. including the socket case), when the channel
loop sends messages to the writer pid, what happens when the writer
dies?
More information about the rabbitmq-discuss
mailing list