summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-03-21 02:03:49 +0000
committerAlan Conway <aconway@apache.org>2007-03-21 02:03:49 +0000
commit862b354f6f777314cd4013f5cbd5aaf0003808d7 (patch)
tree722127acd578fec6cadc5b7ab0f0d864388342ae /python
parentae01787ce90ee7cd1303ce7769328cd242e00f6e (diff)
downloadqpid-python-862b354f6f777314cd4013f5cbd5aaf0003808d7.tar.gz
* python/qpid/*.py:: apply 0-9 changes missed by merge.
* python/cpp_failing_0-9.txt: update tests to refer to tess_0-9 git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@520704 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
-rw-r--r--python/cpp_failing_0-9.txt6
-rw-r--r--python/qpid/client.py3
-rw-r--r--python/qpid/message.py9
-rw-r--r--python/qpid/peer.py15
4 files changed, 22 insertions, 11 deletions
diff --git a/python/cpp_failing_0-9.txt b/python/cpp_failing_0-9.txt
index 5d74874d52..06c31080fb 100644
--- a/python/cpp_failing_0-9.txt
+++ b/python/cpp_failing_0-9.txt
@@ -1,4 +1,4 @@
-tests.message.MessageTests.test_checkpoint
-tests.message.MessageTests.test_reject
-tests.basic.BasicTests.test_get
+tests_0-9.message.MessageTests.test_checkpoint
+tests_0-9.message.MessageTests.test_reject
+tests_0-9.basic.BasicTests.test_get
diff --git a/python/qpid/client.py b/python/qpid/client.py
index e548ef0e99..cdceb87bdf 100644
--- a/python/qpid/client.py
+++ b/python/qpid/client.py
@@ -131,6 +131,9 @@ class ClientDelegate(Delegate):
def basic_deliver(self, ch, msg):
self.client.queue(msg.consumer_tag).put(msg)
+ def channel_pong(self, ch, msg):
+ msg.ok()
+
def channel_close(self, ch, msg):
ch.close(msg)
diff --git a/python/qpid/message.py b/python/qpid/message.py
index 29c8654937..f80293180e 100644
--- a/python/qpid/message.py
+++ b/python/qpid/message.py
@@ -47,9 +47,12 @@ class Message:
else:
for r in self.method.responses:
if attr == r.name:
- result = lambda *args, **kwargs: \
- self.channel.respond(Method(r, r.arguments(*args, **kwargs)),
- self.frame)
+ def respond(*args, **kwargs):
+ batch=0
+ if kwargs.has_key("batchoffset"):
+ batch=kwargs.pop("batchoffset")
+ self.channel.respond(Method(r, r.arguments(*args, **kwargs)), batch, self.frame)
+ result = respond
break
else:
raise AttributeError(attr)
diff --git a/python/qpid/peer.py b/python/qpid/peer.py
index 28db20f187..72e6a19bc7 100644
--- a/python/qpid/peer.py
+++ b/python/qpid/peer.py
@@ -129,6 +129,8 @@ class Peer:
content = None
self.delegate(channel, Message(channel, frame, content))
+ except QueueClosed, e:
+ self.close(e)
except:
self.fatal()
@@ -156,12 +158,15 @@ class Responder:
self.write = writer
self.sequence = Sequence(1)
- def respond(self, method, request):
+ def respond(self, method, batch, request):
if isinstance(request, Method):
self.write(method)
else:
- # XXX: batching
- frame = Response(self.sequence.next(), request.id, 0, method)
+ # allow batching from frame at either end
+ if batch<0:
+ frame = Response(self.sequence.next(), request.id+batch, -batch, method)
+ else:
+ frame = Response(self.sequence.next(), request.id, batch, method)
self.write(frame)
class Closed(Exception): pass
@@ -238,8 +243,8 @@ class Channel:
def request(self, method, listener, content = None):
self.requester.request(method, listener, content)
- def respond(self, method, request):
- self.responder.respond(method, request)
+ def respond(self, method, batch, request):
+ self.responder.respond(method, batch, request)
def invoke(self, type, args, kwargs):
content = kwargs.pop("content", None)