Question

I've a django application, served via Twisted, which also serves ohter services (three sockets, mainly).

I need to have it working under windows, and I decide to write a PyQt4 application which acts quite like Apache Service Monitor for windows.

I was not able to connect twisted reactor to pyqt application reactor, so any hint on this will be welcome too.

Now I've this kind of architecture:

  • QMainWindow which, in __ init __() has the log.addObserver(callBack) function, and the widget.
  • Twisted initializer class which extends QtCore.QThread and works in a different thread.
  • the django app which runs over Twisted.

I need to understand how to run the reactor, becouse calling reactor.start() from QtCore.QThread works not at all, giving me:

exceptions.ValueError: signal only works in main thread

Also I'm asking your opinion on the design of applications, does it makes sense for you?

Was it helpful?

Solution

I'm not sure I totally understand your design but what I can say is that you need to use only one reactor in an application. The reactor is the main (event) loop of the application. And, I think, this reactor should be the QTReactor in your case.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top