def waiter_for(id)
      @waiting[id] = true

      Waiter.new do
        loop do
          break true if !@waiting[id]
          sleep 0.1
        end
      end
    end
def waiter_for(id)
      @waiting[id] = true

      Waiter.new do
        loop do
          break true if !@waiting[id]
          sleep 0.1
        end
      end
    end
Returns an object that can be used to block a thread until a document
 with the given ID has been processed.

 Intended for testing.