Class: Karafka::Processing::Schedulers::Default
- Inherits:
-
Object
- Object
- Karafka::Processing::Schedulers::Default
- Defined in:
- lib/karafka/processing/schedulers/default.rb
Overview
FIFO scheduler for messages coming from various topics and partitions
Instance Method Summary collapse
-
#initialize(queue) ⇒ Default
constructor
A new instance of Default.
-
#on_clear(_group_id) ⇒ Object
This scheduler does not need to be cleared because it is stateless.
-
#on_manage ⇒ Object
This scheduler does not have anything to manage as it is a pass through and has no state.
-
#on_schedule_consumption(jobs_array) ⇒ Object
(also: #on_schedule_revocation, #on_schedule_shutdown, #on_schedule_idle, #on_schedule_eofed)
Schedules jobs in the fifo order.
Constructor Details
#initialize(queue) ⇒ Default
Returns a new instance of Default.
10 11 12 |
# File 'lib/karafka/processing/schedulers/default.rb', line 10 def initialize(queue) @queue = queue end |
Instance Method Details
#on_clear(_group_id) ⇒ Object
This scheduler does not need to be cleared because it is stateless
37 38 39 |
# File 'lib/karafka/processing/schedulers/default.rb', line 37 def on_clear(_group_id) nil end |
#on_manage ⇒ Object
This scheduler does not have anything to manage as it is a pass through and has no state
30 31 32 |
# File 'lib/karafka/processing/schedulers/default.rb', line 30 def on_manage nil end |
#on_schedule_consumption(jobs_array) ⇒ Object Also known as: on_schedule_revocation, on_schedule_shutdown, on_schedule_idle, on_schedule_eofed
Schedules jobs in the fifo order
17 18 19 20 21 |
# File 'lib/karafka/processing/schedulers/default.rb', line 17 def on_schedule_consumption(jobs_array) jobs_array.each do |job| @queue << job end end |