# File lib/ruote/log/wait_logger.rb, line 137
    def wait_for(interests, opts={})

      @waiting << [ Thread.current, interests ]

      Thread.current['__result__'] = nil
      start = Time.now

      to = opts[:timeout] || @timeout
      to = nil if to.nil? || to <= 0

      loop do

        raise(
          Ruote::LoggerTimeout.new(interests, to)
        ) if to && (Time.now - start) > to

        @check_mutex.synchronize { check_waiting }

        break if Thread.current['__result__']

        sleep 0.007
      end

      Thread.current['__result__']
    end