29 Commits

Author SHA1 Message Date
Mark McLoughlin
e2b74cc9e6 Implement a fake driver
A bunch of FIXMEs in here, but it seems like a good start.

Note that this differs from the original fake driver. Rather than the
driver consuming each message in a greenthread, we leave it up to the
choice of executor to determine how the consumer is run in parallel to
the client and we use thread-safe queues to pass the messages and
replies back and forth. The main reason for this is that we don't want
the driver explicitly depending on eventlet.
2013-05-10 15:46:55 +01:00
Mark McLoughlin
4771afb5e2 Adding reply infrastructure
This is pretty rough.
2013-05-11 13:19:59 +01:00
Mark McLoughlin
9a7eb04e13 Add some exceptions 2013-05-11 17:39:31 +01:00
Mark McLoughlin
eb77cbdb6d Fix buglet with default timeout 2013-05-11 17:46:27 +01:00
Mark McLoughlin
27868dd24d Fix target/namespace target buglet 2013-05-11 16:33:33 +01:00
Mark McLoughlin
79f0938613 Fix rpc client buglets 2013-05-11 16:18:36 +01:00
Mark McLoughlin
2e26a082d4 Fix 'Blockinging' typos 2013-05-11 16:23:13 +01:00
Mark McLoughlin
1353bafb7e Missing self parameter to server start() 2013-05-11 16:22:53 +01:00
Mark McLoughlin
246fb5235e Fix default_exchange typo 2013-05-11 16:22:37 +01:00
Mark McLoughlin
bb5d6d94d5 Add forgotten piece of eventlet executor 2013-05-11 13:20:41 +01:00
Mark McLoughlin
7492f2d9ea It's _executors not _executor 2013-05-11 13:20:21 +01:00
Mark McLoughlin
93447e8381 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.
2013-05-11 16:17:00 +01:00
Mark McLoughlin
7c3697f77b Make drivers list public again
Make the list of drivers public via the o.c.m.drivers module.
2013-05-11 13:18:43 +01:00
Mark McLoughlin
e8a0756a3a 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):
     ...
2013-05-11 13:57:51 +01:00
Mark McLoughlin
1fd958678f 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.
2013-05-10 16:07:21 +01:00
Mark McLoughlin
5675f2603e 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.
2013-05-10 16:04:10 +01:00
Mark McLoughlin
ae6019ff82 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
2013-05-10 16:00:42 +01:00
Mark McLoughlin
d588b49cd0 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
2013-05-10 15:48:48 +01:00
Mark McLoughlin
ea2e34f37a Fix little typo in server exception class name 2013-05-10 12:52:21 +01:00
Mark McLoughlin
e54343ba15 Add missing utils module 2013-05-10 12:33:00 +01:00
Mark McLoughlin
a136bb089d 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.
2013-05-10 12:16:16 +01:00
Mark McLoughlin
e14ddb80e5 Update changes.txt for recent API changes 2013-05-10 12:06:20 +01:00
Flaper Fesp
2405fd2619 Use : for loading classes in entry_points 2013-05-08 16:55:56 +02:00
Doug Hellmann
5fb15b61f5 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>
2013-05-06 16:05:10 -04:00
Doug Hellmann
c7e204279b 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>
2013-05-06 15:29:37 -04:00
Flaper Fesp
3a910e8f72 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.
2013-05-06 20:54:12 +02:00
Mark McLoughlin
fb67f72375 Try out replacing "executor" for "dispatcher"
Suggestion from Doug
2013-05-04 11:12:43 +01:00
Mark McLoughlin
6199614494 Fix host vs server typo
Thanks to Eric
2013-05-03 15:20:38 +01:00
Mark McLoughlin
20c3674021 Initial framework 2013-04-30 06:49:56 +01:00