Method: AMQP::Channel#direct
- Defined in:
- lib/amqp/channel.rb
#direct(name = 'amq.direct', opts = {}, &block) ⇒ Exchange
Defines, intializes and returns a direct Exchange instance.
Learn more about direct exchanges in Exchange class documentation.
372 373 374 375 376 377 378 379 380 381 382 383 |
# File 'lib/amqp/channel.rb', line 372 def direct(name = 'amq.direct', opts = {}, &block) if exchange = find_exchange(name) extended_opts = Exchange.(:direct, name, opts, block) validate_parameters_match!(exchange, extended_opts) block.call(exchange) if block exchange else register_exchange(Exchange.new(self, :direct, name, opts, &block)) end end |