Module: Karafka::Routing::Features::ActiveJob::Topic
- Defined in:
- lib/karafka/routing/features/active_job/topic.rb
Overview
Topic extensions to be able to check if given topic is ActiveJob topic
Instance Method Summary collapse
-
#active_job(active = false) ⇒ Object
where the boolean would be an argument.
-
#active_job? ⇒ Boolean
Is this an ActiveJob topic.
-
#to_h ⇒ Hash
Topic with all its native configuration options plus active job namespace settings.
Instance Method Details
#active_job(active = false) ⇒ Object
Note:
Since this feature supports only one setting (active), we can use the old API
where the boolean would be an argument
13 14 15 |
# File 'lib/karafka/routing/features/active_job/topic.rb', line 13 def active_job(active = false) @active_job ||= Config.new(active: active) end |
#active_job? ⇒ Boolean
Returns is this an ActiveJob topic.
18 19 20 |
# File 'lib/karafka/routing/features/active_job/topic.rb', line 18 def active_job? active_job.active? end |
#to_h ⇒ Hash
Returns topic with all its native configuration options plus active job namespace settings.
24 25 26 27 28 |
# File 'lib/karafka/routing/features/active_job/topic.rb', line 24 def to_h super.merge( active_job: active_job.to_h ).freeze end |