def _wait(self):
        try:
            self.logger.debug('VService Active.  Awaiting graceful shutdown.')

            # If there are no remaining tasks (or this service has no tasks)
            # just sleep until ^C is pressed
            while not self._stop:
                time.sleep(0.1)
        except __HOLE__:
            self.logger.info('KeyboardInterrupt Received!  Stopping Tasks...')

        for t in reversed(self.tasks):
            t.stop()

        try:
            self.logger.info('Waiting for tasks to shutdown gracefully...')
            for t in reversed(self.tasks):
                self.logger.debug('Waiting for %s to stop...', t)
                t.join()
        except KeyboardInterrupt:
            self.logger.warning('Abandon all hope ye who enter here')
dataset/ETHPy150Open facebook/sparts/sparts/vservice.py/VService._wait