<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def processWhileRunning(self):
 """ Run tasks until stopService is called. """

        work = self.step()
        for result, more in work:
            yield result
            if not self.running:
                break
            if more:
                delay = 0.1
            else:
                delay = 10.0
            yield task.deferLater(reactor, delay, lambda: None)