def terminate(self):
        '''Kills the work unit.

        This is called by the standard worker system, but only in
        response to an operating system signal.  If the job does setup
        such as creating a child process, its terminate function
        should kill that child process.  More specifically, this
        function requires the work spec to contain the keys
        ``module``, ``run_function``, and ``terminate_function``, and
        calls ``terminate_function`` in :attr:`module` containing
        :const:`self` as its only parameter.

        '''
        terminate_function_name = self.spec.get('terminate_function')
        if not terminate_function_name:
            logger.error('tried to terminate WorkUnit(%r) but no '
                         'function name', self.key)
            return None
        terminate_function = getattr(self.module,
                                     self.spec['terminate_function'])
        if not terminate_function:
            logger.error('tried to terminate WorkUnit(%r) but no '
                         'function %s in module %r',
                         self.key, terminate_function_name,
                         self.module.__name__)
            return None
        logger.info('calling terminate function for work unit {0}'
                    .format(self.key))
        ret_val = terminate_function(self)
        self.update(lease_time=-10)
        return ret_val
Kills the work unit.

        This is called by the standard worker system, but only in
        response to an operating system signal.  If the job does setup
        such as creating a child process, its terminate function
        should kill that child process.  More specifically, this
        function requires the work spec to contain the keys
        ``module``, ``run_function``, and ``terminate_function``, and
        calls ``terminate_function`` in :attr:`module` containing
        :const:`self` as its only parameter.