Module: Vx::Common::AMQP
- Extended by:
- AMQP
- Included in:
- AMQP
- Defined in:
- lib/vx/common/amqp.rb,
lib/vx/common/amqp/cli.rb,
lib/vx/common/amqp/config.rb,
lib/vx/common/amqp/session.rb,
lib/vx/common/amqp/testing.rb,
lib/vx/common/amqp/version.rb,
lib/vx/common/amqp/consumer.rb,
lib/vx/common/amqp/formatter.rb,
lib/vx/common/amqp/consumer/ack.rb,
lib/vx/common/amqp/consumer/publish.rb,
lib/vx/common/amqp/mixins/instrument.rb,
lib/vx/common/amqp/consumer/subscribe.rb,
lib/vx/common/amqp/supervisor/threaded.rb,
lib/vx/common/amqp/consumer/configuration.rb
Defined Under Namespace
Modules: Consumer, Instrument, Supervisor, Testing
Classes: CLI, Config, Formatter, Session
Constant Summary
collapse
- VERSION =
"0.3.0"
- @@config =
Common::AMQP::Config.new
- @@session =
Common::AMQP::Session.new
Instance Method Summary
collapse
Instance Method Details
#close ⇒ Object
44
45
46
|
# File 'lib/vx/common/amqp.rb', line 44
def close
session.close
end
|
#config ⇒ Object
28
29
30
|
# File 'lib/vx/common/amqp.rb', line 28
def config
@@config
end
|
24
25
26
|
# File 'lib/vx/common/amqp.rb', line 24
def configure
yield config
end
|
#instrument(name, payload, &block) ⇒ Object
57
58
59
60
61
62
63
64
65
66
67
|
# File 'lib/vx/common/amqp.rb', line 57
def instrument(name, payload, &block)
if config.debug?
STDOUT.puts "name: #{name} payload: #{payload.inspect}"
end
if config && config.instrumenter
config.instrumenter.instrument(name, payload, &block)
else
yield if block_given?
end
end
|
#open ⇒ Object
36
37
38
|
# File 'lib/vx/common/amqp.rb', line 36
def open
session.open
end
|
#open? ⇒ Boolean
40
41
42
|
# File 'lib/vx/common/amqp.rb', line 40
def open?
session.open?
end
|
#session ⇒ Object
32
33
34
|
# File 'lib/vx/common/amqp.rb', line 32
def session
@@session
end
|