Sha256: f0cc65d2cd81466d23efb7aaf30431b7a9561cff275684a4673f536aa9b7fa72

Contents?: true

Size: 622 Bytes

Versions: 15

Compression:

Stored size: 622 Bytes

Contents

require 'msgr'

Msgr.logger.level = Logger::Severity::INFO

class TestConsumer < Msgr::Consumer
  def index
    log(:info) { payload }
  end

  def another_action
    log(:info) { payload }
  end

  def log_name
    "<TestConsumer##{action}>"
  end
end

@client = Msgr::Client.new user: 'guest', password: 'guest', size: 1

@client.routes.configure do
  route 'abc.#', to: 'test#index'
  route 'cde.#', to: 'test#index'
  route '#', to: 'test#another_action'
end

@client.start

100.times do |i|
  @client.publish 'abc.XXX', "Message #{i} #{rand}"
end

begin
  sleep
rescue Interrupt
ensure
  @client.stop timeout: 10
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
msgr-0.10.2 scripts/simple_test.rb
msgr-0.10.1 scripts/simple_test.rb
msgr-0.10.0 scripts/simple_test.rb
msgr-0.9.0 scripts/simple_test.rb
msgr-0.8.0 scripts/simple_test.rb
msgr-0.7.0 scripts/simple_test.rb
msgr-0.6.0 scripts/simple_test.rb
msgr-0.5.0 scripts/simple_test.rb
msgr-0.4.1 scripts/simple_test.rb
msgr-0.4.0 scripts/simple_test.rb
msgr-0.3.0 scripts/simple_test.rb
msgr-0.2.1 scripts/simple_test.rb
msgr-0.2.0 scripts/simple_test.rb
msgr-0.1.1 scripts/simple_test.rb
msgr-0.1.0 scripts/simple_test.rb