A common pattern in Thinker methods decorated with task_submitter is to begin with something like
while True:
try:
data = self.queue.get(block=True, timeout=1)
except Empty:
if self.done.is_set():
return
else:
break
having this be an optional feature of the task_submitter is desirable to reduce boilerplate and provide this functionality to users directly
A common pattern in
Thinkermethods decorated withtask_submitteris to begin with something likehaving this be an optional feature of the
task_submitteris desirable to reduce boilerplate and provide this functionality to users directly