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