summaryrefslogtreecommitdiff
path: root/cpp/src/qpid
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-09-05 16:30:03 +0000
committerAlan Conway <aconway@apache.org>2008-09-05 16:30:03 +0000
commitc212333a21ca81015035441ad4c7db185581742a (patch)
tree4746759885fdaa9edf2b6148e401f73ebc3fe2b8 /cpp/src/qpid
parentb2b3d97bca484ea0b4733bdc7d65d1333262805b (diff)
downloadqpid-python-c212333a21ca81015035441ad4c7db185581742a.tar.gz
src/qpid/client/SubscriptionManager.cpp: added start().
src/tests* improvements to multi-host test scripts. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@692478 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid')
-rw-r--r--cpp/src/qpid/client/SubscriptionManager.cpp6
-rw-r--r--cpp/src/qpid/client/SubscriptionManager.h13
2 files changed, 17 insertions, 2 deletions
diff --git a/cpp/src/qpid/client/SubscriptionManager.cpp b/cpp/src/qpid/client/SubscriptionManager.cpp
index b4c48f7365..e4d68e723f 100644
--- a/cpp/src/qpid/client/SubscriptionManager.cpp
+++ b/cpp/src/qpid/client/SubscriptionManager.cpp
@@ -124,6 +124,12 @@ void SubscriptionManager::run()
dispatcher.run();
}
+void SubscriptionManager::start()
+{
+ dispatcher.setAutoStop(autoStop);
+ dispatcher.start();
+}
+
void SubscriptionManager::stop()
{
dispatcher.stop();
diff --git a/cpp/src/qpid/client/SubscriptionManager.h b/cpp/src/qpid/client/SubscriptionManager.h
index 3dad15fd29..3a463d9038 100644
--- a/cpp/src/qpid/client/SubscriptionManager.h
+++ b/cpp/src/qpid/client/SubscriptionManager.h
@@ -134,16 +134,25 @@ class SubscriptionManager : public sys::Runnable
/** Cancel a subscription. */
void cancel(const std::string tag);
- /** Deliver messages until stop() is called. */
+ /** Deliver messages in the current thread until stop() is called.
+ * Only one thread may be running in a SubscriptionManager at a time.
+ * @see run
+ */
void run();
+ /** Start a new thread to deliver messages.
+ * Only one thread may be running in a SubscriptionManager at a time.
+ * @see start
+ */
+ void start();
+
/** If set true, run() will stop when all subscriptions
* are cancelled. If false, run will only stop when stop()
* is called. True by default.
*/
void setAutoStop(bool set=true);
- /** Cause run() to return */
+ /** Stop delivery. Causes run() to return, or the thread started with start() to exit. */
void stop();
static const uint32_t UNLIMITED=0xFFFFFFFF;