Sha256: 8c0228d6eece107c281e59612dc16943c099453151a494139928a3201afea822
Contents?: true
Size: 468 Bytes
Versions: 7
Compression:
Stored size: 468 Bytes
Contents
require_relative '../lib/upperkut/worker' require_relative '../lib/upperkut/strategies/priority_queue' class PriorityWorker include Upperkut::Worker setup_upperkut do |config| config.strategy = Upperkut::Strategies::PriorityQueue.new( self, priority_key: -> { |item| item['tenant_id'] }, batch_size: 1 ) end def perform(items) items.each do |item| puts "event dispatched: #{item.inspect}" sleep 1 end end end
Version data entries
7 entries across 7 versions & 1 rubygems