module DramaQueen

This is the singleton that maintains the list of active exchanges.

Constants

VERSION

Public Class Methods

exchange_for(routing_key) click to toggle source

Finds the DramaQueen::Exchange for the given routing_key.

@param [Object] routing_key @return [DramaQueen::Exchange]

# File lib/drama_queen.rb, line 19
def self.exchange_for(routing_key)
  exchanges.find do |exchange|
    exchange.routing_key == routing_key
  end
end
exchanges() click to toggle source

The list of all exchanges that DramaQueen knows about. This is updated by DramaQueen::Consumers as they subscribe to topics.

@return [Array<DramaQueen::Exchange>]

# File lib/drama_queen.rb, line 11
def self.exchanges
  @exchanges ||= Array.new
end
routes_to?(routing_key) click to toggle source

@param [Object] routing_key @return [Boolean]

# File lib/drama_queen.rb, line 27
def self.routes_to?(routing_key)
  !!exchange_for(routing_key)
end
unsubscribe_all() click to toggle source

Removes all exchanges from the exchanges list.

@return [Array]

# File lib/drama_queen.rb, line 34
def self.unsubscribe_all
  @exchanges = Array.new
end