Method: AMQP::Channel#fanout
- Defined in:
- lib/amqp/channel.rb
#fanout(name = 'amq.fanout', opts = {}, &block) ⇒ Exchange
Defines, intializes and returns a fanout Exchange instance.
Learn more about fanout exchanges in Exchange class documentation.
541 542 543 544 545 546 547 548 549 550 551 552 |
# File 'lib/amqp/channel.rb', line 541 def fanout(name = 'amq.fanout', opts = {}, &block) if exchange = find_exchange(name) extended_opts = Exchange.(:fanout, name, opts, block) validate_parameters_match!(exchange, extended_opts, :exchange) block.call(exchange) if block exchange else register_exchange(Exchange.new(self, :fanout, name, opts, &block)) end end |