Pass the driver instance to the listener instead of config

There are a couple of cases where having the driver instance is a good
thing for the Listener, though, I would like to use the connection
management as motivation here:

Instead of creating a new connection for every Listener it would be
possible to let the driver instance managing the whole connect /
reconnect and session handling process.

In the old implementation, when a reconnect happens, the connection
instance calls every consumer and sets the new connection / session to
them.

See: http://github.com/openstack/oslo-incubator/blob/master/openstack/common/rpc/impl_qpid.py#L368

Listeners can access the config instance through the driver instance.
Make driver and transport methods public

The methods of the driver and transport should
be public, since they are used outside of those
classes.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Split the dispatcher from the executor and server

Move the executors into a sub-package and organize the
code so that only one module imports eventlet.

Rename messaging/rpc/server.py to messaging/rpc/dispatcher.py and
leave only the dispatcher there.

Move the rest of the server code to messaging/server.py where it
can be reused with other dispatchers.

Remove the convenience functions for instantiating servers
to avoid having eventlet imported in the module with the base
class.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Use : for loading classes in entry_points
Merge pull request #2 from FlaPer87/messaging

Pass the driver instance to the listener instead of config
Merge pull request #4 from dhellmann/api-design/executor-logic

Split the dispatcher from the executor and server
Update changes.txt for recent API changes

Change-Id: Ia65aa7e08c163acf30cd80eae608dc27c6250a2c
Add convenience RPC server classes

Rather than forcing all users of the server API to construct a
dispatcher and import a specific executor, add a convenience server
class e.g.

  server = eventlet.EventletRPCServer(transport, target, endpoints)

Note that openstack.common.messaging.eventlet need be the only public
module which has a dependency on eventlet. We can expose servers,
clients and anything else eventlet specific through this part of the
API.

Change-Id: I133e6d73fb0f60ea7f5e3b473a32dabc2f968084
Add missing utils module

Change-Id: If7aefadfd02fab379517fb43bac060ca09a89bd6
Fix little typo in server exception class name

Change-Id: Icffe2b9a1c74e4a6347659d0049763ed645f9be0
Merge pull request #3 from dhellmann/api-design/driver-method-names

Make driver and transport methods public
Make transport methods private

These methods are private to the library, so we're prefixing them
with an underscore even though it's a bit unconventional.

See the discussion here:

  https://github.com/markmc/oslo-incubator/pull/3

Change-Id: I178bdda35a31e6e3a5910b04666e23c068eff751
Prefix the drivers module with an underscore

To make it clear that the drivers API isn't public and stable.

See the discussion in:

  https://github.com/markmc/oslo-incubator/pull/3

Change-Id: Ib31375fcbfc749ff5f2508dc49029137acd01bd7
Prefix the messaging.server module with an underscore

I'm assuming for now that we'll have a specific notifications
consumption API which will use this as an internal implementation
detail. We can make this public again in future if/when we know
what the use case for it is.

Change-Id: I1b58fa651a11da60f9ed4b0eb33f073ba452f3e6
Prefix the executors module with underscore

With the MessagingServer API now private, we don't actually need to
expose the concept of an executor.

We may find in future that we want to support an executor type which
we don't want to include in the library itself but, for now, let's
be conservative.

Change-Id: I2c2902441e8e16c8bc620dfc1fbcdb69f8fe6665
Add top-level convenience aliases

This means you can do e.g.

  from openstack.common import messaging

  target = messaging.Target(...)

  transport = messaging.get_transport(...)

  class Client(messaging.RPCClient):
     ...

rather than e.g.

  from openstack.common.messaging.rpc import client
  from openstack.common.messaging import target
  from openstack.common.messaging import transport

  target = target.Target(...)

  transport = transport.get_transport(...)

  class Client(client.RPCClient):
     ...

Change-Id: I8caba590bc7b779b539ef856fa319be2a8521303
Make drivers list public again

Make the list of drivers public via the o.c.m.drivers module.

Change-Id: I195075daabbed87e11f7babbdc60ae76c7d69c9a
Make poll() just return the message

The driver shouldn't be pulling the namespace and version from the
message since that's RPC specific stuff.

Also, it's not terribly useful for the driver to pass back a target
object describing the exchange and topic the message was received on
since that's implicit in the listener.

Change-Id: I08fe27ff84d606a44da331d5bfe26d64a15a983c
It's _executors not _executor

Change-Id: I2820b3cb5ca2b362584a0c59463e963baed6264e
Add forgotten piece of eventlet executor

Change-Id: Ic2f2393ae67079d8d0cd506fe7dcdafad97923e5