Module: Karafka::Pro::Routing::Features::LongRunningJob::Topic
- Defined in:
- lib/karafka/pro/routing/features/long_running_job/topic.rb
Overview
Long-Running Jobs topic API extensions
Instance Method Summary collapse
- #long_running_job(active = false) ⇒ Object (also: #long_running)
-
#long_running_job? ⇒ Boolean
Is a given job on a topic a long-running one.
-
#to_h ⇒ Hash
Topic with all its native configuration options plus lrj.
Instance Method Details
#long_running_job(active = false) ⇒ Object Also known as: long_running
22 23 24 |
# File 'lib/karafka/pro/routing/features/long_running_job/topic.rb', line 22 def long_running_job(active = false) @long_running_job ||= Config.new(active: active) end |
#long_running_job? ⇒ Boolean
Returns is a given job on a topic a long-running one.
29 30 31 |
# File 'lib/karafka/pro/routing/features/long_running_job/topic.rb', line 29 def long_running_job? long_running_job.active? end |
#to_h ⇒ Hash
Returns topic with all its native configuration options plus lrj.
34 35 36 37 38 |
# File 'lib/karafka/pro/routing/features/long_running_job/topic.rb', line 34 def to_h super.merge( long_running_job: long_running_job.to_h ).freeze end |