@cli.command()
@click.option('--result-cls', default='pyspider.result.ResultWorker', callback=load_cls, help='ResultWorker class to be used.')
@click.pass_context
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()

@ cli . command ( ) @ click . option ( '--result-cls' , default = 'pyspider.result.ResultWorker' , callback = load_cls , help = 'ResultWorker class to be used.' ) @ click . pass_context 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 ( )
run result worker .