The job should be removed from the registry immediately once the job is popped from the queue jobs getting killed randomly shouldn't be a problem. We should also be able to use Redis transaction (``pipeline(transaction=True``) to make it more reliable.

As to who's responsible for unregistering the jobs, I think it makes sense to put it inside ``queue.dequeue`` and ``Queue.dequeue_any``.

And finally, we can also add a ``registry.compact`` method to cleanup stale jobs.

What do you think?