def start_with_callback(self, func, args=None, kwargs=None):
        """Start 'func' in a new thread T, then start self (and return T)."""
        if args is None:
            args = ()
        if kwargs is None:
            kwargs = {}
        args = (func,) + args

        def _callback(func, *a, **kw):
            self.wait(states.STARTED)
            func(*a, **kw)

        t = threading.Thread(target=_callback, args=args, kwargs=kwargs)
        t.name = 'Bus Callback ' + t.name
        t.start()

        self.start()

        return t
Start 'func' in a new thread T, then start self (and return T).
cherrypy/process/wspbus.py