Put obj to queue, but will give up when the thread is stopped
(self, q, obj)
| 52 | return self._stop_evt.isSet() |
| 53 | |
| 54 | def queue_put_stoppable(self, q, obj): |
| 55 | """ Put obj to queue, but will give up when the thread is stopped""" |
| 56 | while not self.stopped(): |
| 57 | try: |
| 58 | q.put(obj, timeout=5) |
| 59 | break |
| 60 | except queue.Full: |
| 61 | pass |
| 62 | |
| 63 | def queue_get_stoppable(self, q): |
| 64 | """ Take obj from queue, but will give up when the thread is stopped""" |