Module: Queight

Defined in:
lib/queight.rb,
lib/queight/queue.rb,
lib/queight/client.rb,
lib/queight/version.rb,
lib/queight/exchange.rb,
lib/queight/metadata.rb,
lib/queight/channel_pool.rb,
lib/queight/channel_wrapper.rb,
lib/queight/rabbitmq_config.rb,
lib/queight/connection_cache.rb,
lib/queight/cancellable_subscriber.rb

Defined Under Namespace

Classes: CancellableSubscriber, ChannelPool, ChannelWrapper, Client, ConnectionCache, DefaultExchange, Exchange, Metadata, Queue, RabbitMQConfig

Constant Summary collapse

GlobalConnectionCache =
ConnectionCache.new
VERSION =
"0.12.0"

Class Method Summary collapse

Class Method Details

.currentObject



32
33
34
35
36
# File 'lib/queight.rb', line 32

def self.current
  options = RabbitMQConfig.configure_from!("RABBITMQ_URL").config
  channel_pool = GlobalConnectionCache.call(options)
  Client.new(channel_pool)
end

.default_exchange(message_options = {}) ⇒ Object



16
17
18
# File 'lib/queight.rb', line 16

def self.default_exchange(message_options = {})
  DefaultExchange.new(message_options)
end

.direct(name, message_options = {}) ⇒ Object



24
25
26
# File 'lib/queight.rb', line 24

def self.direct(name, message_options = {})
  Exchange.new(:direct, name, message_options)
end

.fanout(name, message_options = {}) ⇒ Object



28
29
30
# File 'lib/queight.rb', line 28

def self.fanout(name, message_options = {})
  Exchange.new(:fanout, name, message_options)
end

.queue(name, options = {}) ⇒ Object



12
13
14
# File 'lib/queight.rb', line 12

def self.queue(name, options = {})
  Queue.new(name, options)
end

.topic(name, message_options = {}) ⇒ Object



20
21
22
# File 'lib/queight.rb', line 20

def self.topic(name, message_options = {})
  Exchange.new(:topic, name, message_options)
end