module Messaging::Consumer::Extensions

DSL methods which are used to extend the target when {Messaging::Consumer} is included into a class.

Public Instance Methods

subscribe(exchange, type, queue, key) click to toggle source

Subscribe to a queue which will invoke {Messaging::Consumer#on_message} upon receiving a message.

Evaluation: Lazy - consume is required on the instance to evaluate and declare the subscriptions.

@param exchange [String] @param type [String] @param queue [String] @param key [String] @return [Array<Array(String, String, String, String)>] @api public

# File lib/messaging/consumer.rb, line 22
def subscribe(exchange, type, queue, key)
  subscriptions << [exchange, type, queue, key]
end
subscriptions() click to toggle source

A list of subscriptions intended for internal use.

@return [Array<Array(String, String, String, String)>] @api private

# File lib/messaging/consumer.rb, line 30
def subscriptions
  @subscriptions ||= []
end