def run_main(<EOL>need_response=False,<EOL>callback=None):
stop_file = ev("<STR_LIT>",<EOL>"<STR_LIT>")<EOL>num_workers = int(ev("<STR_LIT>",<EOL>"<STR_LIT:1>"))<EOL>shutdown_msg = "<STR_LIT>"<EOL>log.info("<STR_LIT>".format(name))<EOL>log.info("<STR_LIT>")<EOL>tasks = multiprocessing.JoinableQueue()<EOL>queue_to_consume = multiprocessing.Queue()<EOL>host = "<STR_LIT:localhost>"<EOL>log.info("<STR_LIT>")<EOL>consumers = start_consumers_for_queue(<EOL>num_workers=num_workers,<EOL>tasks=tasks,<EOL>queue_to_consume=queue_to_consume,<EOL>shutdown_msg=shutdown_msg,<EOL>consumer_class=WorkerToProcessPackets,<EOL>callback=callback)<EOL>log.info("<STR_LIT>")<EOL>skt = create_layer_2_socket()<EOL>log.info("<STR_LIT>")<EOL>not_done = True<EOL>while not_done:<EOL><INDENT>if not skt:<EOL><INDENT>log.info("<STR_LIT>")<EOL>log.info("<STR_LIT>")<EOL>not_done = False<EOL>break<EOL><DEDENT>try:<EOL><INDENT>if os.path.exists(stop_file):<EOL><INDENT>log.info(("<STR_LIT>")<EOL>.format(stop_file))<EOL>not_done = False<EOL>break<EOL><DEDENT>packet = skt.recvfrom(<NUM_LIT>)<EOL>if os.path.exists(stop_file):<EOL><INDENT>log.info(("<STR_LIT>")<EOL>.format(stop_file))<EOL>not_done = False<EOL>break<EOL><DEDENT>tasks.put(NetworkPacketTask(source=host,<EOL>payload=packet))<EOL><DEDENT>except KeyboardInterrupt as k:<EOL><INDENT>log.info("<STR_LIT>")<EOL>not_done = False<EOL>break<EOL><DEDENT>except Exception as e:<EOL><INDENT>log.error(("<STR_LIT>")<EOL>.format(e))<EOL>not_done = False<EOL>break<EOL><DEDENT><DEDENT>log.info(("<STR_LIT>")<EOL>.format(len(consumers)))<EOL>shutdown_consumers(num_workers=num_workers,<EOL>tasks=tasks)<EOL>if need_response:<EOL><INDENT>log.info("<STR_LIT>")<EOL>tasks.join()<EOL><DEDENT>log.info("<STR_LIT>")<EOL>
run_main

    start the packet consumers and the packet processors

    :param need_response: should send response back to publisher
    :param callback: handler method