def remove(self, task_id):
try:<EOL><INDENT>self._rwlock.writer_acquire()<EOL>del self._tasks[task_id]<EOL><DEDENT>except KeyError:<EOL><INDENT>raise NotFoundError(element=str(task_id))<EOL><DEDENT>finally:<EOL><INDENT>self._rwlock.writer_release()<EOL><DEDENT>logger.debug("<STR_LIT>", str(task_id))<EOL>
Remove a task from the registry.

        To remove it, pass its identifier with `taks_id` parameter.
        When the identifier is not found, a `NotFoundError` exception
        is raised.

        :param task_id: identifier of the task to remove

        :raises NotFoundError: raised when the given task identifier
            is not found on the registry