Class: Karafka::Pro::Processing::ConsumerGroups::Jobs::Periodic

Inherits:
Karafka::Processing::Jobs::Base show all
Defined in:
lib/karafka/pro/processing/consumer_groups/jobs/periodic.rb

Overview

Job that represents a "ticking" work. Work that we run periodically for the Periodics enabled topics.

Direct Known Subclasses

PeriodicNonBlocking

Instance Attribute Summary

Attributes inherited from Karafka::Processing::Jobs::Base

#executor

Instance Method Summary collapse

Methods inherited from Karafka::Processing::Jobs::Base

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

Constructor Details

#initialize(executor) ⇒ Periodic

Returns a new instance of Periodic.

Parameters:



44
45
46
47
# File 'lib/karafka/pro/processing/consumer_groups/jobs/periodic.rb', line 44

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

Instance Method Details

#before_scheduleObject

Code executed before we schedule this job



50
51
52
# File 'lib/karafka/pro/processing/consumer_groups/jobs/periodic.rb', line 50

def before_schedule
  executor.before_schedule_periodic
end

#callObject

Runs the executor periodic action



55
56
57
# File 'lib/karafka/pro/processing/consumer_groups/jobs/periodic.rb', line 55

def call
  executor.periodic
end