activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: How to get a file-descriptor for single-thread async?
Date Thu, 06 Jan 2011 13:53:35 GMT
On Thu, 2011-01-06 at 14:41 +0100, Martin Nicolay wrote:
> On Thu, 6 Jan 2011, Timothy Bish wrote:
> > On Thu, 2011-01-06 at 11:10 +0100, Martin Nicolay wrote:
> > > I want to use activemq-cpp-library asynchronously in a single-threaded 
> > > application.
> [...]
> > The OpenWire-cpp client is a different beast from ActiveMQ-CPP, so the
> > documentation there doesn't translate to the ActiveMQ-CPP architecture.
> > The socket is not exposed in ActiveMQ-CPP.  Perhaps if you elaborate on
> > your use case we can find an alternate solution for you.
> 
> The application is single-threaded and has already a central 
> event-handling object.  No blocking outside this event-handler is 
> permitted and only timer and file-descriptor events are possible.  
> Aside from openwire-cpp-client all other c/c++ APIs seem to use 
> threads or have only blocking calls.  As a last resort polling 
> every second with a call like receiveNoWait() would be possible but 
> borders horseplay.  Nearly 1M LOC of c++ have too much inertia to 
> make a quick transition to a multi-threaded application :-).
> 

Seems like you could use a wrapper around the onMessage callback async
model to signal your own file descriptor or timer event instance to
allow the application interact with the library without the need to
drill down into the guts of the CMS library to try and find a socket
file descriptor that would be unreliable at best as a notification
mechanism.

Regards
Tim.

> Cheers
>   Martin
> -- 
> ______________________________________________________________________________
> No MS-Word attachments (http://www.gnu.org/philosophy/no-word-attachments.html)
> 
> OSM GmbH                               Mail    m.nicolay@osm-gmbh.de
> - Softwareentwicklung -                Telefon +49-201/8955-5
> Ruhrallee 191                          Fax     +49-201/8955-400
> D-45136 Essen                          Web     http://www.osm-gmbh.de
> 
> Registergericht: Amtsgericht Essen, HRB 11281
> Geschäftsführer: Johannes Kuhn, Christian Damsky, Axel Roland
> ______________________________________________________________________________

-- 
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/



Mime
View raw message