class Rodent::Server
Attributes
settings[RW]
Public Class Methods
configure() { || ... }
click to toggle source
# File lib/rodent/server.rb, line 8 def configure(&block) @settings ||= {} yield end
run(&block)
click to toggle source
# File lib/rodent/server.rb, line 17 def run(&block) EM.run do AMQP.connection ||= AMQP.connect(settings[:connection]) block.call.each(&:bind) end end
set(attr, value)
click to toggle source
# File lib/rodent/server.rb, line 13 def set(attr, value) settings[attr] = value end
stop()
click to toggle source
# File lib/rodent/server.rb, line 25 def stop AMQP.connection.close { EM.stop } end