Sha256: 4b73a21a8ea57951734f9f0805c47191dd26e44d62474a58b7ff6dd318ab4de8

Contents?: true

Size: 471 Bytes

Versions: 12

Compression:

Stored size: 471 Bytes

Contents

require_relative './common'

LOG.info('starting consumer')

end_thread = Thread.new do
  Thread.stop
  LOG.info('stopping consumer')
  MessageDriver::Broker.stop
end

ending_proc = proc do
  end_thread.wakeup
end

trap 'TERM', &ending_proc
trap 'INT', &ending_proc

MessageDriver::Broker.consumer(:basic_consumer) do |message|
  LOG.info("I got a message! #{message.body}")
end

MessageDriver::Client.subscribe(:basic_consumer_producer, :basic_consumer)

end_thread.join

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
message-driver-1.0.1 examples/basic_producer_and_consumer/consumer.rb
message-driver-1.0.0 examples/basic_producer_and_consumer/consumer.rb
message-driver-0.7.2 examples/basic_producer_and_consumer/consumer.rb
message-driver-0.7.1 examples/basic_producer_and_consumer/consumer.rb
message-driver-0.7.0 examples/basic_producer_and_consumer/consumer.rb
message-driver-0.6.1 examples/basic_producer_and_consumer/consumer.rb
message-driver-0.6.0 examples/basic_producer_and_consumer/consumer.rb
message-driver-0.5.3 examples/basic_producer_and_consumer/consumer.rb
message-driver-0.5.2 examples/basic_producer_and_consumer/consumer.rb
message-driver-0.5.1 examples/basic_producer_and_consumer/consumer.rb
message-driver-0.5.0 examples/basic_producer_and_consumer/consumer.rb
message-driver-0.4.0 examples/basic_producer_and_consumer/consumer.rb