diff options
author | Ask Solem <ask@celeryproject.org> | 2014-05-28 14:01:54 +0100 |
---|---|---|
committer | Ask Solem <ask@celeryproject.org> | 2014-05-28 14:01:54 +0100 |
commit | a744fe924cef5ca68fea9d7a530cbf9b42b30723 (patch) | |
tree | 93254a1c739a97dbc4855106c1c5ce6464a97253 | |
parent | 9adc992d0a4f7e81b1b32540ad7280114b3f2fd6 (diff) | |
download | librabbitmq-heartbeats.tar.gz |
Hartbeats messheartbeats
-rw-r--r-- | Modules/_librabbitmq/connection.c | 5 | ||||
-rw-r--r-- | librabbitmq/__init__.py | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/Modules/_librabbitmq/connection.c b/Modules/_librabbitmq/connection.c index 8cfe3da..a12059e 100644 --- a/Modules/_librabbitmq/connection.c +++ b/Modules/_librabbitmq/connection.c @@ -1215,11 +1215,15 @@ PyRabbitMQ_recv(PyRabbitMQ_Connection *self, PyObject *p, memset(&props, 0, sizeof(props)); + printf("rabbitmq recv\n"); + while (1) { if (!piggyback) { Py_BEGIN_ALLOW_THREADS; amqp_maybe_release_buffers(conn); + printf("+amqp_simple_wait_frame 1\n"); retval = amqp_simple_wait_frame(conn, &frame); + printf("-amqp_simple_wait_frame 1\n"); Py_END_ALLOW_THREADS; if (retval < 0) break; if (frame.frame_type != AMQP_FRAME_METHOD @@ -1328,6 +1332,7 @@ finally: Py_XDECREF(propdict); Py_XDECREF(delivery_info); Py_XDECREF(view); + printf("-rabbitmq recv\n"); return retval; } diff --git a/librabbitmq/__init__.py b/librabbitmq/__init__.py index 1611016..c7430b7 100644 --- a/librabbitmq/__init__.py +++ b/librabbitmq/__init__.py @@ -182,10 +182,12 @@ class Connection(_librabbitmq.Connection): channel_max=channel_max, frame_max=frame_max, heartbeat=heartbeat) + self.channels = {} self._avail_channel_ids = array('H', xrange(self.channel_max, 0, -1)) if not lazy: self.connect() + print('INIT WITH HEARTBEAT: %r' % (self.heartbeat, )) def __enter__(self): return self |