Module: Karafka::Pro::Routing::Features::RecurringTasks::Topic
- Defined in:
- lib/karafka/pro/routing/features/recurring_tasks/topic.rb
Overview
Topic extensions to be able to check if given topic is a recurring tasks topic Please note, that this applies to both the schedules topics and reports topics
Instance Method Summary collapse
- #recurring_tasks(active = false) ⇒ Object
-
#recurring_tasks? ⇒ Boolean
Is this an ActiveJob topic.
-
#to_h ⇒ Hash
Topic with all its native configuration options plus active job namespace settings.
Instance Method Details
#recurring_tasks(active = false) ⇒ Object
23 24 25 |
# File 'lib/karafka/pro/routing/features/recurring_tasks/topic.rb', line 23 def recurring_tasks(active = false) @recurring_tasks ||= Config.new(active: active) end |
#recurring_tasks? ⇒ Boolean
Returns is this an ActiveJob topic.
28 29 30 |
# File 'lib/karafka/pro/routing/features/recurring_tasks/topic.rb', line 28 def recurring_tasks? recurring_tasks.active? end |
#to_h ⇒ Hash
Returns topic with all its native configuration options plus active job namespace settings.
34 35 36 37 38 |
# File 'lib/karafka/pro/routing/features/recurring_tasks/topic.rb', line 34 def to_h super.merge( recurring_tasks: recurring_tasks.to_h ).freeze end |