Ticket #5: turbomail-2.0.3-timeout.patch
| File turbomail-2.0.3-timeout.patch, 0.7 kB (added by kevinvisac@…, 2 years ago) |
|---|
-
turbomail/pool.py
59 59 60 60 log.debug("Thread pool created.") 61 61 62 def enqueue(self, work ):62 def enqueue(self, work, block=True, timeout=None): 63 63 """Enqueue a Message instance. 64 64 65 65 @param work: The unit of work can be any callable that returns a … … 71 71 """ 72 72 73 73 if callable(work): 74 self._queue.put(work() )74 self._queue.put(work(), block, timeout) 75 75 else: 76 self._queue.put(work )76 self._queue.put(work, block, timeout) 77 77 78 78 optimum_threads = min(self._threads, math.ceil(self._queue.qsize() / float(self._jobs))) 79 79
