'interleave(waker) interleaves this reactor with the
current application by moving the blocking parts of
the reactor (select() in this case) to a separate
thread.  This is typically useful for integration with
GUI applications which have their own event loop
already running.
See the module docstring for more information.'

def interleave(self, waker, *args, **kw):

    self.startRunning(*args, **kw)
    loop = self._interleave()
    def mainWaker(waker=waker, loop=loop):
        waker(partial(next, loop))
    self.mainWaker = mainWaker
    next(loop)
    self.ensureWorkerThread()
