Class: LogStash::PipelineAction::Stop
- Defined in:
- lib/logstash/pipeline_action/stop.rb
Instance Attribute Summary collapse
-
#pipeline_id ⇒ Object
readonly
Returns the value of attribute pipeline_id.
Instance Method Summary collapse
- #execute(agent, pipelines) ⇒ Object
-
#initialize(pipeline_id) ⇒ Stop
constructor
A new instance of Stop.
Methods inherited from Base
#<=>, #execution_priority, #inspect
Constructor Details
#initialize(pipeline_id) ⇒ Stop
Returns a new instance of Stop.
10 11 12 |
# File 'lib/logstash/pipeline_action/stop.rb', line 10 def initialize(pipeline_id) @pipeline_id = pipeline_id end |
Instance Attribute Details
#pipeline_id ⇒ Object (readonly)
Returns the value of attribute pipeline_id.
8 9 10 |
# File 'lib/logstash/pipeline_action/stop.rb', line 8 def pipeline_id @pipeline_id end |
Instance Method Details
#execute(agent, pipelines) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/logstash/pipeline_action/stop.rb', line 14 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 |