Improve consumer.pl:

* use Getopt::Long to enable/disable help, verbose and print mode;
* add proper usage message;
* keep track of total messages received.

Signed-off-by: Pedro Melo <melo@simplicidade.org>
Add support for the factors parameter in publisher.pl:

We can multiply the number of messages delivery by factor, thus allowing
to test support for publishing multiple messages

Signed-off-by: Pedro Melo <melo@simplicidade.org>
Update publish() on both Connection and Writer to use MPUB if need be:

We accept a list of messages now, before the trailing optional callback.

If multiple messages are present, we switch to MPUB.

Signed-off-by: Pedro Melo <melo@simplicidade.org>
Move publish() public API to Client, even Readers get to publish sometimes

Signed-off-by: Pedro Melo <melo@simplicidade.org>
Make consumer.pl trap SIGINT and SIGTERM, disconnect cleanly

Signed-off-by: Pedro Melo <melo@simplicidade.org>
Add --stats support for consumer:

Gives stats over the last 10 seconds, plus global rate.

Use with http_publisher.pl to test your consumer performance.

Signed-off-by: Pedro Melo <melo@simplicidade.org>