lib/logstash/plugin_mixins/elasticsearch/common.rb
def after_successful_connection(&block)
      Thread.new do
        sleep_interval = @retry_initial_interval
        until successful_connection? || @stopping.true?
          @logger.debug("Waiting for connectivity to Elasticsearch cluster, retrying in #{sleep_interval}s")
          sleep_interval = sleep_for_interval(sleep_interval)
        end
        block.call if successful_connection?
      end
    end
# launch a thread that waits for an initial successful connection to the ES cluster to call the given block
# @param block [Proc] the block to execute upon initial successful connection
# @return [Thread] the successful connection wait thread
launch a thread that waits for an initial successful connection to the ES cluster to call the given block
launch a thread that waits for an initial successful connection to the ES cluster to call the given block
def after_successful_connection(&block)
      Thread.new do
        sleep_interval = @retry_initial_interval
        until successful_connection? || @stopping.true?
          @logger.debug("Waiting for connectivity to Elasticsearch cluster, retrying in #{sleep_interval}s")
          sleep_interval = sleep_for_interval(sleep_interval)
        end
        block.call if successful_connection?
      end
    end
def after_successful_connection ( & block ) Thread . new do sleep_interval = @retry_initial_interval until successful_connection? || @stopping . true? @logger . debug ( "Waiting for connectivity to Elasticsearch cluster, retrying in #{sleep_interval}s" ) sleep_interval = sleep_for_interval ( sleep_interval ) end block . call if successful_connection? end end
launch a thread that waits for an initial successful connection to the ES cluster to call the given block
launch a thread that waits for an initial successful connection to the ES cluster to call the given block
the successful connection wait thread
the successful connection wait thread
Thread
block
the block to execute upon initial successful connection
the block to execute upon initial successful connection