Sha256: 6abd8318056cc2e5dce46929978bcbf74bbba2dd41cfb54d200268f2f0e99ae1

Contents?: true

Size: 687 Bytes

Versions: 14

Compression:

Stored size: 687 Bytes

Contents

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

module LogStash module PipelineAction
  class Stop < Base
    attr_reader :pipeline_id

    def initialize(pipeline_id)
      @pipeline_id = pipeline_id
    end

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
logstash-core-6.2.4-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.2.3-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.1.4-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.2.2-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.2.1-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.2.0-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.1.3-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.1.2-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.1.1-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.1.0-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.0.1-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.0.0-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.0.0.rc2-java lib/logstash/pipeline_action/stop.rb
logstash-core-6.0.0.rc1-java lib/logstash/pipeline_action/stop.rb