code: def process_item(self, item):
          
          logger.debug("Processing item: %s (queue size: %s)", item,
                       self.queue.qsize())
          method, kwargs = item
  
          if method not in self.supported_methods:
              raise Error("Not expected service method: {}".format(method))
  
          try:
              if method == "log":
                  self.process_log(**kwargs)
              else:
                  self._post_log_batch()
                  getattr(self.rp_client, method)(**kwargs)
          except Exception:
              if self.error_handler:
                  self.error_handler(sys.exc_info())
              else:
                  self.terminate(nowait=True)
                  raise
docs: Main item handler.
  
          Called by queue listener.