def _worker_method(self):
while not self._should_quit():<EOL><INDENT>try:<EOL><INDENT>task = self._inq.get(block=True, timeout=<NUM_LIT>)<EOL><DEDENT>except TypeError:<EOL><INDENT>if self._should_quit():<EOL><INDENT>break<EOL><DEDENT>else:<EOL><INDENT>raise<EOL><DEDENT><DEDENT>except Empty:<EOL><INDENT>continue<EOL><DEDENT>try:<EOL><INDENT>if settings.ENABLE_CACHING:<EOL><INDENT>obj_data = cache.get(task.key)<EOL>if obj_data:<EOL><INDENT>task.outq.put((task.key, json.loads(obj_data)))<EOL>raise FoundInCache()<EOL><DEDENT><DEDENT>btype = task.client.bucket_type(task.bucket_type)<EOL>obj = btype.bucket(task.bucket).get(task.key, **task.options)<EOL>if not obj.exists:<EOL><INDENT>raise NotFound()<EOL><DEDENT>if settings.ENABLE_CACHING:<EOL><INDENT>cache.set(task.key, json.dumps(obj.data), settings.CACHE_EXPIRE_DURATION)<EOL><DEDENT>task.outq.put((task.key, obj.data))<EOL><DEDENT>except KeyboardInterrupt:<EOL><INDENT>raise<EOL><DEDENT>except FoundInCache or NotFound:<EOL><INDENT>pass<EOL><DEDENT>except Exception as err:<EOL><INDENT>errdata = (task.bucket_type, task.bucket, task.key, err)<EOL>task.outq.put(errdata)<EOL><DEDENT>finally:<EOL><INDENT>self._inq.task_done()<EOL><DEDENT><DEDENT>
The body of the multi-get worker. Loops until
:meth:`_should_quit` returns ``True``, taking tasks off the
input queue, fetching the object, and putting them on the
output queue.