Skip Menu |

This queue is for tickets about the Net-DBus CPAN distribution.

Report information
The Basics
Id: 21426
Status: resolved
Priority: 0/
Queue: Net-DBus

People
Owner: Nobody in particular
Requestors: emmanuel.rodriguez [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.33.3
Fixed in: (no value)



Subject: Integration with other event loops
From my understanding of the library, DBus performs all signal communication asynchronously. This requires the usage of an event loop which is provided through the class Net::DBus::Reactor. The problem is that certain programs have their own event loop, for instance the libraries GLib, GTK and GStreamer. Since Net::DBus doesn't provide a way to be handled by another even loop, using DBus with these libraries causes some problems when dealing with asynchronous messages. The package Linux::Inotify2 provides a good example on how to use different event loops.
From: DANBERR [...] cpan.org
On Mon Sep 11 12:33:21 2006, emmanuel.rodriguez@gmail.com wrote: Show quoted text
> From my understanding of the library, DBus performs all signal > communication asynchronously. This requires the usage of an event loop > which is provided through the class Net::DBus::Reactor. The problem is > that certain programs have their own event loop, for instance the > libraries GLib, GTK and GStreamer. > > Since Net::DBus doesn't provide a way to be handled by another even > loop, using DBus with these libraries causes some problems when dealing > with asynchronous messages. > > The package Linux::Inotify2 provides a good example on how to use > different event loops.
The reason Net::DBus doesn't allow use of GLib currently is that I didn't want to force user's Net::DBus to have glib shared libraries installed. To address this issue I am creating a separate Net::DBus::GLib module to provide integration with the GLib event loop. The code to use GLib event loop instead of the pure-Perl reactor would look something like: my $bus = Net::DBus::GLib->session(); my $service = $bus->export_service("org.designfu.SampleService"); my $object = SomeObject->new($service); Glib::MainLoop->new()->run(); Will update this ticket when the GLib addon is available.
Integration with the GLib event loop is now available on CPAN from the Net::DBus::GLib module: http://search.cpan.org/dist/Net-DBus-GLib/