def callFromThread(self, f, *args, **kw):
            """
            See
            L{twisted.internet.interfaces.IReactorFromThreads.callFromThread}.
            """
            assert callable(f), "%s is not callable" % (f,)
            # lists are thread-safe in CPython, but not in Jython
            # this is probably a bug in Jython, but until fixed this code
            # won't work in Jython.
            self.threadCallQueue.append((f, args, kw))
            self.wakeUp()

            See
            L{twisted.internet.interfaces.IReactorFromThreads.callFromThread}.
            
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/base.py