Sha256: e0d923d31a45b1bf2a1629aa0c92958ed96c76e86994b41f986455bfa7a7048b
Contents?: true
Size: 558 Bytes
Versions: 1
Compression:
Stored size: 558 Bytes
Contents
require 'bunny_carrot' require 'logger' require "stringio" logger = Logger.new(StringIO.new) BunnyCarrot.logger = logger ENV["RABBITMQ_URL"] = "amqp://127.0.0.1:5672" QUEUE_NAME, MESSAGE = *ARGV BunnyCarrot::RabbitHole.publish queue_name: QUEUE_NAME, payload: { message: MESSAGE } sleep 1 class BusinessWorker < BunnyCarrot::BaseWorker def perform(payload, headers) print payload['message'] end end begin Timeout.timeout(5) do BunnyCarrot::Consumer.subscribe(QUEUE_NAME, BusinessWorker.new, block: true) end rescue Timeout::Error end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bunny_carrot-0.0.2 | spec/fixtures/producer_and_consumer.rb |