summaryrefslogtreecommitdiff
path: root/python/qpid
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2007-02-13 21:52:30 +0000
committerAndrew Stitcher <astitcher@apache.org>2007-02-13 21:52:30 +0000
commit5d8e8d39e1e5e13d0753c53a8095f075895d01a1 (patch)
tree727d30e03ae1679827779560a32f11c12f32d4a5 /python/qpid
parent9517deedff9691dbe3429b0b917dfd4208b0b1b8 (diff)
downloadqpid-python-5d8e8d39e1e5e13d0753c53a8095f075895d01a1.tar.gz
r1111@fuschia: andrew | 2007-02-09 15:51:10 +0000
Removed currently unused request tracking logic r1125@fuschia: andrew | 2007-02-13 21:51:30 +0000 Implemented receiveing batched Message.ok in c++ broker Implemented batched response frames in python client code git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@507249 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid')
-rw-r--r--python/qpid/message.py9
-rw-r--r--python/qpid/peer.py13
2 files changed, 14 insertions, 8 deletions
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 9f9644f17d..3f7be699c2 100644
--- a/python/qpid/peer.py
+++ b/python/qpid/peer.py
@@ -155,12 +155,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
@@ -237,8 +240,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)