(self)
| 96 | |
| 97 | print("Example 6") |
| 98 | def run(self): |
| 99 | while True: |
| 100 | self.polled_count += 1 |
| 101 | try: |
| 102 | item = self.in_queue.get() |
| 103 | except IndexError: |
| 104 | time.sleep(0.01) # No work to do |
| 105 | except AttributeError: |
| 106 | # The magic exit signal to make this easy to show in |
| 107 | # example code, but don't use this in practice. |
| 108 | return |
| 109 | else: |
| 110 | result = self.func(item) |
| 111 | self.out_queue.put(result) |
| 112 | self.work_done += 1 |
| 113 | |
| 114 | |
| 115 | print("Example 7") |
no test coverage detected