summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-10-30 21:07:28 +0000
committerAlan Conway <aconway@apache.org>2008-10-30 21:07:28 +0000
commit364b62744a35f7e48332af00217a1848345cd39a (patch)
treed8cab9a5c824133e4429919a9c129beaec0ce456 /cpp/src/qpid/client
parent5e79599484a675baabf45e6b2c50635dbd6b1119 (diff)
downloadqpid-python-364b62744a35f7e48332af00217a1848345cd39a.tar.gz
Replicate session state for un-acknowledged messages to new cluster members.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@709242 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client')
-rw-r--r--cpp/src/qpid/client/LocalQueue.cpp8
-rw-r--r--cpp/src/qpid/client/LocalQueue.h10
2 files changed, 9 insertions, 9 deletions
diff --git a/cpp/src/qpid/client/LocalQueue.cpp b/cpp/src/qpid/client/LocalQueue.cpp
index 229d3766ef..e449c9f795 100644
--- a/cpp/src/qpid/client/LocalQueue.cpp
+++ b/cpp/src/qpid/client/LocalQueue.cpp
@@ -33,12 +33,12 @@ using namespace framing;
LocalQueue::LocalQueue() {}
LocalQueue::~LocalQueue() {}
-Message LocalQueue::pop() { return get(); }
+Message LocalQueue::pop(sys::Duration timeout) { return get(timeout); }
-Message LocalQueue::get() {
+Message LocalQueue::get(sys::Duration timeout) {
Message result;
- bool ok = get(result, sys::TIME_INFINITE);
- assert(ok); (void) ok;
+ bool ok = get(result, timeout);
+ if (!ok) throw Exception("Timed out waiting for a message");
return result;
}
diff --git a/cpp/src/qpid/client/LocalQueue.h b/cpp/src/qpid/client/LocalQueue.h
index 9fe72762c3..3be2293810 100644
--- a/cpp/src/qpid/client/LocalQueue.h
+++ b/cpp/src/qpid/client/LocalQueue.h
@@ -56,14 +56,14 @@ class LocalQueue {
*/
bool get(Message& result, sys::Duration timeout=0);
- /** Get the next message off the local queue, or wait for a
- * message from the broker queue.
- *@exception ClosedException if subscription has been closed.
+ /** Get the next message off the local queue, or wait up to the timeout
+ * for message from the broker queue.
+ *@exception ClosedException if subscription is closed or timeout exceeded.
*/
- Message get();
+ Message get(sys::Duration timeout=sys::TIME_INFINITE);
/** Synonym for get(). */
- Message pop();
+ Message pop(sys::Duration timeout=sys::TIME_INFINITE);
/** Return true if local queue is empty. */
bool empty() const;