Class: Karafka::Processing::Jobs::Idle

Inherits:
Base
  • Object
show all
Defined in:
lib/karafka/processing/jobs/idle.rb

Overview

Type of job that we may use to run some extra handling that happens without the user related lifecycle event like consumption, revocation, etc.

Instance Attribute Summary

Attributes inherited from Base

#executor

Instance Method Summary collapse

Methods inherited from Base

#after_call, #before_call, #finish!, #finished?, #non_blocking?, #wrap

Constructor Details

#initialize(executor) ⇒ Shutdown

Parameters:



14
15
16
17
# File 'lib/karafka/processing/jobs/idle.rb', line 14

def initialize(executor)
  @executor = executor
  super()
end

Instance Method Details

#before_scheduleObject

Runs code prior to scheduling this idle job



20
21
22
# File 'lib/karafka/processing/jobs/idle.rb', line 20

def before_schedule
  executor.before_schedule_idle
end

#callObject

Run the idle work via the executor



25
26
27
# File 'lib/karafka/processing/jobs/idle.rb', line 25

def call
  executor.idle
end