module Vx::Lib::Consumer::ClassMethods

Attributes

logger[RW]

Public Instance Methods

ack() click to toggle source
# File lib/vx/lib/consumer.rb, line 74
def ack
  params.ack = true
end
allocate_pub_channel() { || ... } click to toggle source
# File lib/vx/lib/consumer.rb, line 86
def allocate_pub_channel
  Consumer.session.allocate_pub_channel { yield }
end
configuration() click to toggle source
# File lib/vx/lib/consumer.rb, line 90
def configuration
  Consumer.configuration
end
content_type(value) click to toggle source
# File lib/vx/lib/consumer.rb, line 70
def content_type(value)
  params.content_type = value
end
direct() click to toggle source
# File lib/vx/lib/consumer.rb, line 53
def direct
  params.exchange_type = :direct
end
exchange(*args) click to toggle source
# File lib/vx/lib/consumer.rb, line 40
def exchange(*args)
  params.exchange_options = args.last.is_a?(Hash) ? args.pop : nil
  params.exchange_name    = args.first
end
fanout() click to toggle source
# File lib/vx/lib/consumer.rb, line 45
def fanout
  params.exchange_type = :fanout
end
headers(value) click to toggle source
# File lib/vx/lib/consumer.rb, line 66
def headers(value)
  params.headers = value
end
model(value) click to toggle source
# File lib/vx/lib/consumer.rb, line 78
def model(value)
  params.model = value
end
params() click to toggle source
# File lib/vx/lib/consumer.rb, line 36
def params
  @params ||= Params.new(self.name)
end
queue(*args) click to toggle source
# File lib/vx/lib/consumer.rb, line 57
def queue(*args)
  params.queue_options = args.last.is_a?(Hash) ? args.pop : nil
  params.queue_name    = args.first
end
routing_key(name) click to toggle source
# File lib/vx/lib/consumer.rb, line 62
def routing_key(name)
  params.routing_key = name
end
session() click to toggle source
# File lib/vx/lib/consumer.rb, line 82
def session
  Consumer.session
end
topic() click to toggle source
# File lib/vx/lib/consumer.rb, line 49
def topic
  params.exchange_type = :topic
end
with_middlewares(name, env, &block) click to toggle source
# File lib/vx/lib/consumer.rb, line 94
def with_middlewares(name, env, &block)
  Consumer.configuration.builders[name].to_app(block).call(env)
end