summaryrefslogtreecommitdiff
path: root/qpid/cpp/bindings/qpid
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2014-01-22 15:57:36 +0000
committerGordon Sim <gsim@apache.org>2014-01-22 15:57:36 +0000
commit51a25d7f950fd2220542727593fa48d24961a1a1 (patch)
treec6afda4d7e25081b61f27e99565fc91ad1e8f030 /qpid/cpp/bindings/qpid
parenta7982ebadaaf85254c9fb33d56657e3934d68cd3 (diff)
downloadqpid-python-51a25d7f950fd2220542727593fa48d24961a1a1.tar.gz
QPID-5503: expose next_receiver through swig wrapper, add test for both 1.0 and 0-10
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1560395 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/bindings/qpid')
-rw-r--r--qpid/cpp/bindings/qpid/python/qpid_messaging.i9
1 files changed, 9 insertions, 0 deletions
diff --git a/qpid/cpp/bindings/qpid/python/qpid_messaging.i b/qpid/cpp/bindings/qpid/python/qpid_messaging.i
index 624cee35bc..8063db5967 100644
--- a/qpid/cpp/bindings/qpid/python/qpid_messaging.i
+++ b/qpid/cpp/bindings/qpid/python/qpid_messaging.i
@@ -146,6 +146,7 @@ QPID_EXCEPTION(UnauthorizedAccess, SessionError)
%rename(_acknowledge_all) qpid::messaging::Session::acknowledge(bool);
%rename(_acknowledge_msg) qpid::messaging::Session::acknowledge(
Message &, bool);
+%rename(_next_receiver) qpid::messaging::Session::nextReceiver;
%rename(_fetch) qpid::messaging::Receiver::fetch;
%rename(unsettled) qpid::messaging::Receiver::getUnsettled;
@@ -245,6 +246,14 @@ QPID_EXCEPTION(UnauthorizedAccess, SessionError)
s = self._sender(target)
s._setDurable(options.get("durable"))
return s
+
+ def next_receiver(self, timeout=None) :
+ if timeout is None :
+ return self._next_receiver()
+ else :
+ # Python API uses timeouts in seconds,
+ # but C++ API uses milliseconds
+ return self._next_receiver(Duration(int(1000*timeout)))
%}
}