diff options
author | Soren Hansen <soren@linux2go.dk> | 2011-02-15 14:02:19 +0100 |
---|---|---|
committer | Soren Hansen <soren@linux2go.dk> | 2011-02-15 14:02:19 +0100 |
commit | dfcf07192cf40d0451c7dfa3802994e4cef8d116 (patch) | |
tree | 390e06f667c44657e71335ef0393cac092e22699 /nova/rpc.py | |
parent | 799f5222e5eea2825f1e05a66e44eb4df709234e (diff) | |
download | nova-dfcf07192cf40d0451c7dfa3802994e4cef8d116.tar.gz nova-dfcf07192cf40d0451c7dfa3802994e4cef8d116.tar.xz nova-dfcf07192cf40d0451c7dfa3802994e4cef8d116.zip |
Naïve attempt at threading rpc requests.
Diffstat (limited to 'nova/rpc.py')
-rw-r--r-- | nova/rpc.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nova/rpc.py b/nova/rpc.py index 2b1f7298b..efe6164ad 100644 --- a/nova/rpc.py +++ b/nova/rpc.py @@ -29,6 +29,7 @@ import uuid from carrot import connection as carrot_connection from carrot import messaging +from eventlet import greenpool from eventlet import greenthread from nova import context @@ -155,11 +156,15 @@ class AdapterConsumer(TopicConsumer): def __init__(self, connection=None, topic="broadcast", proxy=None): LOG.debug(_('Initing the Adapter Consumer for %s') % topic) self.proxy = proxy + self.pool = greenpool.GreenPool(1024) super(AdapterConsumer, self).__init__(connection=connection, topic=topic) + def receive(self, *args, **kwargs): + self.pool.spawn_n(self._receive, *args, **kwargs) + @exception.wrap_exception - def receive(self, message_data, message): + def _receive(self, message_data, message): """Magically looks for a method on the proxy object and calls it Message data should be a dictionary with two keys: |