client connect via 127.0.0.1 rather than *
fix for unscriptable error in method _format_args_spec
Remove useless code

Removing an useless binary and, thanks to @zachaysan
Update tests/test_zmq.py

remove unused module
Upgrade from pyzmq-static to pyzmq>=2.2.0.1

pyzmq-static is now integrated into pyzmq.
bump version to v0.3.1
Enhance concurrent load on one zmq socket

Handle better the ZMQ/gevent bug that lead to miss change of state
events on a zmq socket. Also take care of the gevent bug of timeout that
triggers too early.

The initial workaround for the missing event bug was subject to the
gevent timeout early triggering. The workaround of one bug hitting a
second bug in its resolution! Yay! So much fun!

I tested everything with a simple echo service, a relay service which,
as its name says, relay messages to the echo service, and two client
connected to the relay service.

With one client connected, everything was fine, but with more than one,
the relay service was slowing down (by 90%!!!) because of the
combination of the missing event bug and the early triggering of timeout
one.

This patch reduce a little the throughput with one client (8.3% of loss)
because it involve more polling. In exchange adding more client doesn't
kill the performances anymore. And the relay and echo services are able
to tackle more requests per seconds as you add more clients (this is a
good sign).

Hopefully this wont introduce any other magical combination of any other
weird an obscure bug between ZMQ and Gevent...
Fix a typo in the most recent commit.
Merge pull request #45 from adieu/typo

Fix a typo in the most recent commit.
Introduce a new middleware API

This changeset deeply changes the middleware API. The spirit stays the
same, but everything has been (at least) renamed, pre-existing
middlewares will unconditionally break. The new API:

- is much more clear;
- offers better instrumentation opportunities (e.g: call tracing or the
  Raven/Sentry middleware).

The following hooks changed:

- call_procedure has been replaced by server_before_exec and
  server_after_exec, there is two reasons for this:
  * while kinda elegant it wouldn't allow any context (like the request
    or reply event) to be passed to the middleware because it had to
    take the exact same argument as the real (i.e: the served) method to
    be called;
  * I think two hooks are more clear here.
- inspect_error has been renamed to server_inspect_exception for clarity;
- raise_error has been replaced by client_handle_remote_error, not only
  the name is more clear, but it also return the new exception instead
  of raising it, which leave the liberty to the middleware to just
  inspect the exception on the client side (by returning nothing);

The hooks also receive much more context than before (mainly via request
and reply events objects).

Two new client hooks are introduced:

- client_before_request: called before the request is sent to the
  server;
- client_after_request: called when an answer or a timeout has been
  received from the server.

Unit tests have been added and updated accordingly. Moreover, PUB/SUB
tests showed errors which seem to be an independent problem from this
changeset and originate from pyzmq/libzmq directly; thus they have been
disabled (you can use nose --no-skip to run them).
Remove the client_return_answer hook from the list

This hook was already removed (it was redundant with
client_after_request).
Fix the PUB/SUB tests

FX kindly reminded that the Subscriber must be reading on the ZMQ socket
*before* the send from the publisher to get the message. In other words,
the test failures were a perfectly expected behavior from ZMQ.

Thus, this changeset add some retry logic to give the time to the
subscriber.run coroutine to trigger a read.
Pass the request event to the client_after_request hook

This is useful to get some context on the current task when the reply
event is None (either because we are timing out or because we are
talking to a PUSH/PULL or PUB/SUB).

It also replaces the useless method argument from the patterns.
bump version to v0.4.0
Add argparse as install requirement only when Python < 2.7
Fix indentation
Fix AttributeError on timeout with async

oc = zerorpc.Client(connect_to="tcp://127.0.0.1:8003")
oc.test('whats up', async=True).wait()

If there is a timeout:
An exception is raised: "AttributeError: 'str' object has no attribute 'name'"

Thanks jvangael for the bug report.

This patch also add a test case.
bump version to v0.4.1
Merge pull request #52 from maxpersson/setup.py-argparse

Add argparse as install requirement only when Python < 2.7
Harden zerorpc against malformed msgpack messages.

If an error occur while receiving a message in a channel multiplexer,
the error will be ignored, and a detailed error will be printed out on
stderr.

This will keep your service running when receiving broken messages.