From: Jason G. <jgl...@go...> - 2010-12-06 19:59:20
|
see main() for how we attach the dbus-c++ dispatcher to the glib main loop. http://git.chromium.org/gitweb/?p=cashew.git;a=blob;f=src/main.cc;h=d7f64fe5f37b99e91d7eb2ef9e4566f01833e521;hb=HEAD#l102 -Jason On Mon, Dec 6, 2010 at 1:04 PM, Theodore A. Roth <ta...@gm...> wrote: > On Mon, Dec 6, 2010 at 7:31 AM, Jason Glasgow <jgl...@go...> wrote: > > You might try using g_timeout_add_seconds. We have used it with > dbus-c++. > > > http://git.chromium.org/gitweb/?p=cashew.git;a=blob;f=src/device.cc;h=b5ac6f5103d8a1c05e82b0f6633d7bd6b965b6a0;hb=HEAD > > -Jason > > Jason, > > Right. That's exactly what I want to do, but doesn't using > g_timeout_add_seconds() imply that you are using the glib event loop > and thus have to link to glib? > > I need to integrate my dispatcher with our own event loops so need to > be event loop agnostic and we want to avoid using glib if possible. > > I was under the (most likely mistaken) impression the the generic > dispatcher provided its own event loop which got started when you > invoke dispatcher.enter(). Sounds like I need to do some more homework > into how the dispatcher works. ;-) > > I have written some simple python apps that use the glib event loop to > send a heartbeat signal and I was hoping to achieve the same thing > using the default dispatcher. > > Ted Roth > > > > > On Sun, Dec 5, 2010 at 4:58 PM, Andreas Volz <li...@br...> > wrote: > >> > >> Am Fri, 3 Dec 2010 16:23:08 -0700 schrieb Theodore A. Roth: > >> > >> > I've been trying to figure out how to register a timeout callback with > >> > the dispatcher so that my callback function will be invoked > >> > periodically by the dispatcher main loop. The > >> > BusDispatcher::add_timeout() method seems to take an internal timeout > >> > object as an argument which leads me to believe that I can't use that. > >> > > >> > I'm still in the learning dbus-c++ phase and my app is a rather simple > >> > server based on the echo demo, but I've stripped it down to only a > >> > Hello method and a single signal. My goal is to invoked the signal in > >> > the timeout. > >> > > >> > None of the examples in the source repo show how to do what I what, > >> > and google hasn't been too helpful. If someone has a link to an > >> > example of this, I would be most appreciative. > >> > >> Hello Ted, > >> > >> yes, BusDispatcher::add_timeout() is for another reason. To be honest I > >> never needed such an feature. Are you sure the C backend of DBus > >> provides such a feature? Could you name a function? > >> > >> I would solve this by writing an interface to a DBus service that > >> provides you with configurable callbacks. :-) > >> > >> regards > >> Andreas > >> > >> > >> > ------------------------------------------------------------------------------ > >> What happens now with your Lotus Notes apps - do you make another costly > >> upgrade, or settle for being marooned without product support? Time to > >> move > >> off Lotus Notes and onto the cloud with Force.com, apps are easier to > >> build, > >> use, and manage than apps on traditional platforms. Sign up for the > Lotus > >> Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d > >> _______________________________________________ > >> dbus-cplusplus-devel mailing list > >> dbu...@li... > >> https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel > > > > > > > ------------------------------------------------------------------------------ > > What happens now with your Lotus Notes apps - do you make another costly > > upgrade, or settle for being marooned without product support? Time to > move > > off Lotus Notes and onto the cloud with Force.com, apps are easier to > build, > > use, and manage than apps on traditional platforms. Sign up for the Lotus > > Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d > > _______________________________________________ > > dbus-cplusplus-devel mailing list > > dbu...@li... > > https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel > > > > > |