Menu:

Delicious!

arrow Drawing with jquery

arrow Mobile applications RIP

arrow Lighthttpd tuning

arrow Kännykästä WLAN tukiasema

arrow MySQL advanced performance tips

 left_thumb_25102008-002.jpgleft_thumb_24102008-032.jpgleft_thumb_24102008-015.jpgleft_thumb_24102008-013.jpgleft_thumb_20092008.jpg 

Dezign
(4 Janv, 2007)

How Midgard 2 talks between between machines

Posted on 2008-10-25 19:30:48 EEST.


I gave today a workshop about the basic functionalities of Midgard 2. One of them is the dbus signaling and it's possibilities. After that we hade quite intense hacking session with XMPP and Midgard 2. And what did we archive?

I described in one of my blogposts how easy it is to signal. So when some code is added, I can send serialized midgard objects via XMPP

Basically there's some normal code for initialization for the dbus and twisted framework in python but the magic happens with

# initialization code
....

def replicate:
        # some preparing code for connection etc
        msg = domish.Element(("jabber:client", "message"))
        msg["to"] = "bergie@example.net"
        body = msg.addElement("body", content = replicationpackage)
        self.xmlstream.send(msg)

mbus = midgard.dbus("/mgdschema/midgard_page/create")
mbus.connect("notified", replicate, "foo")

Now we need a working receiver and probably Bergie is going to tell about is some more. This rocks we'll may have sooner than expected some P2P applications with Midgard.

Back