zeromq/zproto — pull request #153 by hintjens (2014-11-11 10:14:28+00:00)
Title: Problem: mixing commands and messages is clumsy

This is an anti-pattern, as we have synchronous commands and async
message flows on a single actor pipe. It's OK for actors that do
their work in the background. For actors that do heavy message I/O
to the application, it's bad.

Several problems: you get message data mixed in with replies for
commands; you are punished for using pretty printable text in
high volume message flows (or you have to switch to binary for
everything, which is also nasty).

Solution: adopt the Cheap & Nasty pattern from the Guide, split
the flows into two, and use two separate sockets. We already did
this in Zyre some time ago. zsys now provides zsys_create_pipe
which makes this easy.

Specifically: before creating the client actor, create a second
pipe, and pass the backend of that to the actor as its argument.

For naming, I'm using "cmdpipe" and "msgpipe" consistently now.