Class: Karafka::Pro::Processing::SubscriptionGroupsCoordinator
- Inherits:
-
Object
- Object
- Karafka::Pro::Processing::SubscriptionGroupsCoordinator
- Includes:
- Singleton
- Defined in:
- lib/karafka/pro/processing/subscription_groups_coordinator.rb
Overview
Uses the jobs queue API to lock (pause) and unlock (resume) operations of a given subscription group. It is abstracted away from jobs queue on this layer because we do not want to introduce jobs queue as a concept to the consumers layer
Instance Method Summary collapse
- #pause(subscription_group, lock_id = nil, **kwargs) ⇒ Object
- #resume(subscription_group, lock_id = nil) ⇒ Object
Instance Method Details
#pause(subscription_group, lock_id = nil, **kwargs) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/karafka/pro/processing/subscription_groups_coordinator.rb', line 28 def pause(subscription_group, lock_id = nil, **kwargs) jobs_queue.lock_async( subscription_group.id, lock_id, **kwargs ) end |
#resume(subscription_group, lock_id = nil) ⇒ Object
39 40 41 |
# File 'lib/karafka/pro/processing/subscription_groups_coordinator.rb', line 39 def resume(subscription_group, lock_id = nil) jobs_queue.unlock_async(subscription_group.id, lock_id) end |