Take obj from queue, but will give up when the thread is stopped
(self, q)
| 61 | pass |
| 62 | |
| 63 | def queue_get_stoppable(self, q): |
| 64 | """ Take obj from queue, but will give up when the thread is stopped""" |
| 65 | while not self.stopped(): |
| 66 | try: |
| 67 | return q.get(timeout=5) |
| 68 | except queue.Empty: |
| 69 | pass |
| 70 | |
| 71 | |
| 72 | class LoopThread(StoppableThread): |