Class: Dionysus::Producer::Genesis::Streamer
- Inherits:
-
Object
- Object
- Dionysus::Producer::Genesis::Streamer
- Defined in:
- lib/dionysus/producer/genesis/streamer.rb
Defined Under Namespace
Classes: BaseJob, StandardJob
Instance Method Summary collapse
-
#initialize(job_class: Dionysus::Producer::Genesis::Streamer::StandardJob, config: Dionysus::Producer.configuration) ⇒ Streamer
constructor
A new instance of Streamer.
- #stream(topic, model_class, from, to, options = {}) ⇒ Object
Constructor Details
#initialize(job_class: Dionysus::Producer::Genesis::Streamer::StandardJob, config: Dionysus::Producer.configuration) ⇒ Streamer
Returns a new instance of Streamer.
7 8 9 10 11 |
# File 'lib/dionysus/producer/genesis/streamer.rb', line 7 def initialize(job_class: Dionysus::Producer::Genesis::Streamer::StandardJob, config: Dionysus::Producer.configuration) @job_class = job_class @config = config end |
Instance Method Details
#stream(topic, model_class, from, to, options = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/dionysus/producer/genesis/streamer.rb', line 13 def stream(topic, model_class, from, to, = {}) resources = fetch_resources(model_class, from, to, ) job_class.enqueue( resources, model_class, topic, number_of_days: .fetch(:number_of_days, 1), batch_size: .fetch(:batch_size, 1000) ) end |