Class: Vx::Consumer::Configuration
- Inherits:
-
Object
- Object
- Vx::Consumer::Configuration
- Defined in:
- lib/vx/consumer/configuration.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(&block) ⇒ Object
Returns the value of attribute on_error.
-
#pool_timeout ⇒ Object
Returns the value of attribute pool_timeout.
-
#prefetch ⇒ Object
Returns the value of attribute prefetch.
-
#spawn_attempts ⇒ Object
Returns the value of attribute spawn_attempts.
Instance Method Summary collapse
- #debug? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #reset! ⇒ Object
- #use(target, middleware, *args) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
12 13 14 |
# File 'lib/vx/consumer/configuration.rb', line 12 def initialize reset! end |
Instance Attribute Details
#builders ⇒ Object
Returns the value of attribute builders.
7 8 9 |
# File 'lib/vx/consumer/configuration.rb', line 7 def builders @builders end |
#content_type ⇒ Object
Returns the value of attribute content_type.
7 8 9 |
# File 'lib/vx/consumer/configuration.rb', line 7 def content_type @content_type end |
#debug ⇒ Object
Returns the value of attribute debug.
7 8 9 |
# File 'lib/vx/consumer/configuration.rb', line 7 def debug @debug end |
#default_exchange_options ⇒ Object
Returns the value of attribute default_exchange_options.
7 8 9 |
# File 'lib/vx/consumer/configuration.rb', line 7 def end |
#default_exchange_type ⇒ Object
Returns the value of attribute default_exchange_type.
7 8 9 |
# File 'lib/vx/consumer/configuration.rb', line 7 def default_exchange_type @default_exchange_type end |
#default_publish_options ⇒ Object
Returns the value of attribute default_publish_options.
7 8 9 |
# File 'lib/vx/consumer/configuration.rb', line 7 def end |
#default_queue_options ⇒ Object
Returns the value of attribute default_queue_options.
7 8 9 |
# File 'lib/vx/consumer/configuration.rb', line 7 def end |
#heartbeat ⇒ Object
Returns the value of attribute heartbeat.
7 8 9 |
# File 'lib/vx/consumer/configuration.rb', line 7 def heartbeat @heartbeat end |
#instrumenter ⇒ Object
Returns the value of attribute instrumenter.
7 8 9 |
# File 'lib/vx/consumer/configuration.rb', line 7 def instrumenter @instrumenter end |
#on_error(&block) ⇒ Object
Returns the value of attribute on_error.
7 8 9 |
# File 'lib/vx/consumer/configuration.rb', line 7 def on_error @on_error end |
#pool_timeout ⇒ Object
Returns the value of attribute pool_timeout.
7 8 9 |
# File 'lib/vx/consumer/configuration.rb', line 7 def pool_timeout @pool_timeout end |
#prefetch ⇒ Object
Returns the value of attribute prefetch.
7 8 9 |
# File 'lib/vx/consumer/configuration.rb', line 7 def prefetch @prefetch end |
#spawn_attempts ⇒ Object
Returns the value of attribute spawn_attempts.
7 8 9 |
# File 'lib/vx/consumer/configuration.rb', line 7 def spawn_attempts @spawn_attempts end |
Instance Method Details
#debug? ⇒ Boolean
16 17 18 |
# File 'lib/vx/consumer/configuration.rb', line 16 def debug? ENV['VX_CONSUMER_DEBUG'] end |
#reset! ⇒ Object
29 30 31 32 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 |
# File 'lib/vx/consumer/configuration.rb', line 29 def reset! @default_exchange_type = :topic @pool_timeout = 0.5 @heartbeat = :server @spawn_attempts = 1 @content_type = 'application/json' @prefetch = 1 @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, auto_delete: false, exclusive: false } = { } end |
#use(target, middleware, *args) ⇒ Object
20 21 22 |
# File 'lib/vx/consumer/configuration.rb', line 20 def use(target, middleware, *args) @builders[target].use middleware, *args end |