Start our callback in its own background thread.
(self)
| 546 | self.name = name |
| 547 | |
| 548 | def start(self): |
| 549 | """Start our callback in its own background thread.""" |
| 550 | if self.frequency > 0: |
| 551 | threadname = self.name or self.__class__.__name__ |
| 552 | if self.thread is None: |
| 553 | self.thread = BackgroundTask(self.frequency, self.callback, |
| 554 | bus=self.bus) |
| 555 | self.thread.name = threadname |
| 556 | self.thread.start() |
| 557 | self.bus.log('Started monitor thread %r.' % threadname) |
| 558 | else: |
| 559 | self.bus.log('Monitor thread %r already started.' % threadname) |
| 560 | start.priority = 70 |
| 561 | |
| 562 | def stop(self): |
no test coverage detected