Module: Upperkut::Worker::ClassMethods
- Extended by:
- Forwardable
- Defined in:
- lib/upperkut/worker.rb
Instance Method Summary collapse
- #fetch_items ⇒ Object
- #push_items(items) ⇒ Object
- #setup ⇒ Object
- #setup_upperkut {|setup| ... } ⇒ Object
Instance Method Details
#fetch_items ⇒ Object
24 25 26 |
# File 'lib/upperkut/worker.rb', line 24 def fetch_items strategy.fetch_items end |
#push_items(items) ⇒ Object
18 19 20 21 22 |
# File 'lib/upperkut/worker.rb', line 18 def push_items(items) client_middlewares.invoke(self, items) do strategy.push_items(items) end end |
#setup ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/upperkut/worker.rb', line 32 def setup @config ||= begin config = Upperkut::Configuration.default.clone config.strategy ||= Upperkut::Strategies::BufferedQueue.new(self) config end end |
#setup_upperkut {|setup| ... } ⇒ Object
28 29 30 |
# File 'lib/upperkut/worker.rb', line 28 def setup_upperkut yield(setup) if block_given? end |