def register_hooks(self, on_terminate=None, on_reload=None,<EOL>on_new_worker=None, on_dead_worker=None):
if on_terminate is not None:<EOL><INDENT>_utils.check_callable(on_terminate, '<STR_LIT>')<EOL>self._hooks['<STR_LIT>'].append(on_terminate)<EOL><DEDENT>if on_reload is not None:<EOL><INDENT>_utils.check_callable(on_reload, '<STR_LIT>')<EOL>self._hooks['<STR_LIT>'].append(on_reload)<EOL><DEDENT>if on_new_worker is not None:<EOL><INDENT>_utils.check_callable(on_new_worker, '<STR_LIT>')<EOL>self._hooks['<STR_LIT>'].append(on_new_worker)<EOL><DEDENT>if on_dead_worker is not None:<EOL><INDENT>_utils.check_callable(on_dead_worker, '<STR_LIT>')<EOL>self._hooks['<STR_LIT>'].append(on_dead_worker)<EOL><DEDENT>
Register hook methods

        This can be callable multiple times to add more hooks, hooks are
        executed in added order. If a hook raised an exception, next hooks
        will be not executed.

        :param on_terminate: method called on SIGTERM
        :type on_terminate: callable()
        :param on_reload: method called on SIGHUP
        :type on_reload: callable()
        :param on_new_worker: method called in the child process when this one
                              is ready
        :type on_new_worker: callable(service_id, worker_id, service_obj)
        :param on_new_worker: method called when a child died
        :type on_new_worker: callable(service_id, worker_id, exit_code)

        If window support is planned, hooks callable must support
        to be pickle.pickle(). See CPython multiprocessing module documentation
        for more detail.