Class: Vx::Common::AMQP::Config
- Inherits:
-
Object
- Object
- Vx::Common::AMQP::Config
- Defined in:
- lib/vx/common/amqp/config.rb
Instance Attribute Summary collapse
-
#builders ⇒ Object
Returns the value of attribute builders.
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#default_exchange_options ⇒ Object
Returns the value of attribute default_exchange_options.
-
#default_exchange_type ⇒ Object
Returns the value of attribute default_exchange_type.
-
#default_publish_options ⇒ Object
Returns the value of attribute default_publish_options.
-
#default_queue_options ⇒ Object
Returns the value of attribute default_queue_options.
-
#heartbeat ⇒ Object
Returns the value of attribute heartbeat.
-
#instrumenter ⇒ Object
Returns the value of attribute instrumenter.
-
#on_error ⇒ Object
Returns the value of attribute on_error.
-
#pool_timeout ⇒ Object
Returns the value of attribute pool_timeout.
-
#spawn_attempts ⇒ Object
Returns the value of attribute spawn_attempts.
Instance Method Summary collapse
- #debug? ⇒ Boolean
- #default_exchange_name ⇒ Object
- #formatter ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #reset! ⇒ Object
- #use(target, middleware, *args) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
13 14 15 |
# File 'lib/vx/common/amqp/config.rb', line 13 def initialize reset! end |
Instance Attribute Details
#builders ⇒ Object
Returns the value of attribute builders.
8 9 10 |
# File 'lib/vx/common/amqp/config.rb', line 8 def builders @builders end |
#content_type ⇒ Object
Returns the value of attribute content_type.
8 9 10 |
# File 'lib/vx/common/amqp/config.rb', line 8 def content_type @content_type end |
#debug ⇒ Object
Returns the value of attribute debug.
8 9 10 |
# File 'lib/vx/common/amqp/config.rb', line 8 def debug @debug end |
#default_exchange_options ⇒ Object
Returns the value of attribute default_exchange_options.
8 9 10 |
# File 'lib/vx/common/amqp/config.rb', line 8 def end |
#default_exchange_type ⇒ Object
Returns the value of attribute default_exchange_type.
8 9 10 |
# File 'lib/vx/common/amqp/config.rb', line 8 def default_exchange_type @default_exchange_type end |
#default_publish_options ⇒ Object
Returns the value of attribute default_publish_options.
8 9 10 |
# File 'lib/vx/common/amqp/config.rb', line 8 def end |
#default_queue_options ⇒ Object
Returns the value of attribute default_queue_options.
8 9 10 |
# File 'lib/vx/common/amqp/config.rb', line 8 def end |
#heartbeat ⇒ Object
Returns the value of attribute heartbeat.
8 9 10 |
# File 'lib/vx/common/amqp/config.rb', line 8 def heartbeat @heartbeat end |
#instrumenter ⇒ Object
Returns the value of attribute instrumenter.
8 9 10 |
# File 'lib/vx/common/amqp/config.rb', line 8 def instrumenter @instrumenter end |
#on_error ⇒ Object
Returns the value of attribute on_error.
8 9 10 |
# File 'lib/vx/common/amqp/config.rb', line 8 def on_error @on_error end |
#pool_timeout ⇒ Object
Returns the value of attribute pool_timeout.
8 9 10 |
# File 'lib/vx/common/amqp/config.rb', line 8 def pool_timeout @pool_timeout end |
#spawn_attempts ⇒ Object
Returns the value of attribute spawn_attempts.
8 9 10 |
# File 'lib/vx/common/amqp/config.rb', line 8 def spawn_attempts @spawn_attempts end |
Instance Method Details
#debug? ⇒ Boolean
25 26 27 |
# File 'lib/vx/common/amqp/config.rb', line 25 def debug? @debug || ENV['VX_COMMON_AMQP_DEBUG'] end |
#default_exchange_name ⇒ Object
21 22 23 |
# File 'lib/vx/common/amqp/config.rb', line 21 def default_exchange_name "amq.#{default_exchange_type}" end |
#formatter ⇒ Object
17 18 19 |
# File 'lib/vx/common/amqp/config.rb', line 17 def formatter Common::AMQP::Formatter end |
#reset! ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/vx/common/amqp/config.rb', line 33 def reset! @default_exchange_type = :topic @pool_timeout = 0.1 @heartbeat = 10 @publishing_builder = nil @recieving_builder = nil @subscribing_builder = nil @spawn_attempts = 1 @content_type = 'application/json' @callbacks = {} @instrumenter = nil @on_error = ->(e, env){ nil } @builders = { pub: Vx::Common::Rack::Builder.new, sub: Vx::Common::Rack::Builder.new } = { durable: true, auto_delete: false } = { durable: true, autodelete: false, exclusive: false } = { durable: false } end |
#use(target, middleware, *args) ⇒ Object
29 30 31 |
# File 'lib/vx/common/amqp/config.rb', line 29 def use(target, middleware, *args) @builders[target].use middleware, *args end |