Class: Karafka::Pro::Processing::Executor

Inherits:
Karafka::Processing::Executor show all
Defined in:
lib/karafka/pro/processing/executor.rb

Overview

Pro executor that supports periodic jobs

Instance Attribute Summary

Attributes inherited from Karafka::Processing::Executor

#coordinator, #group_id, #id, #messages

Instance Method Summary collapse

Methods inherited from Karafka::Processing::Executor

#after_consume, #before_consume, #before_schedule_consume, #before_schedule_eofed, #before_schedule_idle, #before_schedule_revoked, #before_schedule_shutdown, #consume, #eofed, #idle, #initialize, #revoked, #shutdown

Constructor Details

This class inherits a constructor from Karafka::Processing::Executor

Instance Method Details

#before_schedule_periodicObject

Note:

While jobs are called Periodic, from the consumer perspective it is “ticking”. This name was taken for a reason: we may want to introduce periodic ticking also not only during polling but for example on wait and a name “poll” would not align well. A name “periodic” is not a verb and our other consumer actions are verbs like: consume or revoked. So for the sake of consistency we have ticking here.

Runs the code that should happen before periodic job is scheduled



26
27
28
# File 'lib/karafka/pro/processing/executor.rb', line 26

def before_schedule_periodic
  consumer.on_before_schedule_tick
end

#periodicObject

Triggers consumer ticking



31
32
33
# File 'lib/karafka/pro/processing/executor.rb', line 31

def periodic
  consumer.on_tick
end