Class: Karafka::Processing::ConsumerGroups::Jobs::Shutdown
- Inherits:
-
Jobs::Base
- Object
- Jobs::Base
- Karafka::Processing::ConsumerGroups::Jobs::Shutdown
- Defined in:
- lib/karafka/processing/consumer_groups/jobs/shutdown.rb
Overview
Job that runs on each active consumer upon process shutdown (one job per consumer).
Instance Attribute Summary
Attributes inherited from Jobs::Base
Instance Method Summary collapse
-
#before_schedule ⇒ Object
Runs code prior to scheduling this shutdown job.
-
#call ⇒ Object
Runs the shutdown job via an executor.
- #initialize(executor) ⇒ Shutdown constructor
Methods inherited from Jobs::Base
#after_call, #before_call, #finish!, #finished?, #non_blocking?, #wrap
Constructor Details
#initialize(executor) ⇒ Shutdown
14 15 16 17 |
# File 'lib/karafka/processing/consumer_groups/jobs/shutdown.rb', line 14 def initialize(executor) @executor = executor super() end |
Instance Method Details
#before_schedule ⇒ Object
Runs code prior to scheduling this shutdown job
20 21 22 |
# File 'lib/karafka/processing/consumer_groups/jobs/shutdown.rb', line 20 def before_schedule executor.before_schedule_shutdown end |
#call ⇒ Object
Runs the shutdown job via an executor.
25 26 27 |
# File 'lib/karafka/processing/consumer_groups/jobs/shutdown.rb', line 25 def call executor.shutdown end |