Sha256: 2c9bf51d4b214a160e411ccf80ee043d94849a3aa9a78ff3939d26cdb483ea53
Contents?: true
Size: 628 Bytes
Versions: 12
Compression:
Stored size: 628 Bytes
Contents
require_relative './common' LOG.info('starting producer') stopping = false ending_proc = proc do stopping = true end trap 'TERM', &ending_proc trap 'INT', &ending_proc counter = 0 until stopping 10.times do counter += 1 begin MessageDriver::Client.publish(:basic_consumer_producer, "message #{counter}") rescue MessageDriver::ConnectionError => e LOG.info("The connection is closed! #{e}") sleep 1 LOG.info('retrying...') retry end end LOG.info("sent 10 more messages for a total of #{counter}") sleep 1 end LOG.info('stopping producer') MessageDriver::Broker.stop
Version data entries
12 entries across 12 versions & 1 rubygems