qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Chase <adam.cha...@gmail.com>
Subject Re: Interupting SubscriptionManager::run()
Date Tue, 14 Apr 2009 17:26:24 GMT
Why don't you just have the subscription manager running in its own
thread?  I think that's the way it was designed to run.  Depending on
what you do in your listener, you might need to use some locks.  Or
you could use LocalQueues which allow you to call get and they will
take care of the synchronization.

Adam

On 4/14/09, RickW <rick.way@in-deptheng.com> wrote:
>
> What is the standard way for using QPID with other event-driven tools that
> want to control the dispatch loop (like Xt and Qt)?
>
> I was thinking of calling SubscriptionManager::run() periodically. I am
> considering something like this. Can stop() be called in another thread like
> this? (I.E. not in a listener) Is there a better way?
>
> void *waitThread(void *arg);
>
> void processQpidMessageForAWhile()
> {
>   pthread_t thread;
>   pthread_create(&thread, NULL, waitThread, NULL);
>   mySubscriptionManager.run();
> }
>
> void *waitThread(void *arg)
> {
>    usleep(/* some interval */);
>    mySubscriptionManager.stop();
> }
>
> Thanks in advance,
> Rick
> --
> View this message in context:
> http://n2.nabble.com/Interupting-SubscriptionManager%3A%3Arun%28%29-tp2634272p2634272.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Mime
View raw message