Motorcycle Adventures and Free Software
Henri Bergius
Biker, free software consultant, neogeographer

This entry was posted on 2008-04-08 13:11:37 UTC in 60° 10.524 N 24° 55.146 E Helsinki, FI to

Interprocess communications in Midgard: D-Bus comes to the web

In his recent blog post, Piotr Pokora showed how the the D-Bus API will work in Midgard 2. D-Bus is an interprocess communications system that is used heavily in modern Linux desktops like GNOME and KDE. With Midgard, the same system now becomes available for PHP and web applications:

midgard_python "service":
import dbus.mainloop.glib
import _midgard as midgard

def mbus_callback(object, arg):
        print "Hi! I am midgard_dbus from midgard-python. I got message:"
        print object.get_message()

mbus = midgard.dbus("/midgard_article")
mbus.connect("notified", mbus_callback, "foo")

mainloop = gobject.MainLoop()
mainloop.run()
midgard-php "client":
$message = "Greetings from midgard-php!(" . mgd_version() . ") PHP ver." . phpversion();
midgard_dbus::send("/midgard_article", $message);
I started php script which immidietialy[sic] ended, and on midgard-python service's terminal I got this message:
Hi! I am midgard_dbus from midgard-python. I got message:
Greetings from midgard-php! (2.0alpha0) PHP ver.5.2.5-3

This is a major milestone in our greater plan for the future of Midgard, and should be interesting to also other PHP and web application developers.

Good work, Piotras!

Technorati Tags: dbus, midgard, php, python

Sponsored links

Microsoft Certification Exams โนเกีย Nokia มือถือ Online Project Management Association Website Software
collaboration software save money using, phone card Reviews มือถือ Mobile All Apps

Back