Sha256: 931caa3e76c18bb52d9a51065f24ce2a57415531c17b607f113e2720fed7fc46

Contents?: true

Size: 708 Bytes

Versions: 12

Compression:

Stored size: 708 Bytes

Contents

# encoding: utf-8
require "logstash/pipeline_action/base"

module LogStash module PipelineAction
  class Stop < Base
    attr_reader :pipeline_id

    def initialize(pipeline_id)
      @pipeline_id = pipeline_id
    end

    def execute(agent, pipelines)
      pipelines.compute(pipeline_id) do |_,pipeline|
        pipeline.shutdown { LogStash::ShutdownWatcher.start(pipeline) }
        pipeline.thread.join
        nil # delete the pipeline
      end
      # If we reach this part of the code we have succeeded because
      # the shutdown call will block.
      return LogStash::ConvergeResult::SuccessfulAction.new
    end

    def to_s
      "PipelineAction::Stop<#{pipeline_id}>"
    end
  end
end end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
logstash-core-6.6.0-java lib/logstash/pipeline_action/stop.rb
logstash-core-7.0.0.alpha2-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.5.4-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.5.3-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.5.2-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.5.1-java lib/logstash/pipeline_action/stop.rb
logstash-core-7.0.0.alpha1-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.5.0-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.4.3-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.4.2-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.4.1-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.4.0-java lib/logstash/pipeline_action/stop.rb