3
This module provides support for Twisted to interact with the glib mainloop.
4
This is like gtk2, but slightly faster and does not require a working
5
$DISPLAY. However, you cannot run GUIs under this reactor: for that you must
6
use the gtk2reactor instead.
8
In order to use this support, simply do the following::
10
| from twisted.internet import glib2reactor
11
| glib2reactor.install()
13
Then use twisted.internet APIs as usual. The other methods here are not
14
intended to be called directly.
16
When installing the reactor, you can choose whether to use the glib
17
event loop or the GTK+ event loop which is based on it but adds GUI
20
Maintainer: Itamar Shtull-Trauring
23
from twisted.internet import gtk2reactor
27
class Glib2Reactor(gtk2reactor.Gtk2Reactor):
29
The reactor using the glib mainloop.
34
Override init to set the C{useGtk} flag.
36
gtk2reactor.Gtk2Reactor.__init__(self, useGtk=False)
42
Configure the twisted mainloop to be run inside the glib mainloop.
44
reactor = Glib2Reactor()
45
from twisted.internet.main import installReactor
46
installReactor(reactor)