code: def result_worker(ctx, result_cls, get_object=False):
      
      g = ctx.obj
      ResultWorker = load_cls(None, None, result_cls)
  
      result_worker = ResultWorker(resultdb=g.resultdb, inqueue=g.processor2result)
  
      g.instances.append(result_worker)
      if g.get('testing_mode') or get_object:
          return result_worker
  
      result_worker.run()
docs: Run result worker.