Sha256: 1a55869fbd2499f0f090743194c4175035662270a8418d09f42a60f84d9e6f32

Contents?: true

Size: 471 Bytes

Versions: 6

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

6 entries across 6 versions & 1 rubygems

Version Path
message-driver-0.3.0 examples/basic_producer_and_consumer/consumer.rb
message-driver-0.2.2 examples/basic_producer_and_consumer/consumer.rb
message-driver-0.2.1 examples/basic_producer_and_consumer/consumer.rb
message-driver-0.2.0 examples/basic_producer_and_consumer/consumer.rb
message-driver-0.2.0.rc2 examples/basic_producer_and_consumer/consumer.rb
message-driver-0.2.0.rc1 examples/basic_producer_and_consumer/consumer.rb