[Twisted-Python] Multiple reactors, connecting to self, or other solution?

Oon-Ee Ng ngoonee.talk at gmail.com
Sun Nov 15 08:19:49 MST 2015


Based on my reading/searching, multiple reactors in the same process
(even in multiple threads) is pretty much a no-go because
twisted.internet.reactor is a global singleton.

I'm also unable to find any information about connecting to self (for
example, to send messages from one reactor to itself).

The situation I find myself in is that of message-passing between a
data-access component of a process (separate thread) and a GUI
component. In this case, something like blinker works fine. However I
want to replace blinker with twisted message-passing, because I want
the data-access component to be accessible by different GUI
components, either on the same machine or from a different machine. Or
from the same process (default behaviour).

If I'm able to somehow either run multiple reactors or
connect-to-self, then I only need to maintain one API (a twisted API)
for this communication, which would be identical between the
one-process, multi-process, and multi-machine case.

As an aside - I want to avoid restricting myself to a multi-process
implementation as that would mean I can't write for iOs (no
multi-processing allowed).



More information about the Twisted-Python mailing list