def worker_wrapper(worker_instance, pid_path):
def exit_handler(*args):<EOL><INDENT>"""<STR_LIT>"""<EOL>if len(args) > <NUM_LIT:0>:<EOL><INDENT>print("<STR_LIT>".format(signal=args[<NUM_LIT:0>]))<EOL><DEDENT>remove(pid_path)<EOL><DEDENT>atexit.register(exit_handler)<EOL>signal.signal(signal.SIGINT, exit_handler)<EOL>signal.signal(signal.SIGTERM, exit_handler)<EOL>worker_instance.work()<EOL>exit_handler(<NUM_LIT:2>)<EOL>
A wrapper to start RQ worker as a new process.

:param worker_instance: RQ's worker instance
:param pid_path: A file to check if the worker
    is running or not