Module: AMQ::Client::Async::Extensions::RabbitMQ::Basic::ConsumerMixin

### Home Classes Methods

### In Files

- lib/amq/client/async/extensions/rabbitmq/cancel.rb

### Methods

- ::included
- #handle_cancel
- #on_cancel

### Class/Module Index

Quicksearch

- AMQ
- AMQ::Client
- AMQ::Client::Async
- AMQ::Client::Async::Adapter
- AMQ::Client::Async::Adapter::ClassMethods
- AMQ::Client::Async::AuthMechanismAdapter
- AMQ::Client::Async::AuthMechanismAdapter::External
- AMQ::Client::Async::AuthMechanismAdapter::Plain
- AMQ::Client::Async::Callbacks
- AMQ::Client::Async::Channel
- AMQ::Client::Async::Consumer
- AMQ::Client::Async::CoolioClient
- AMQ::Client::Async::CoolioClient::Socket
- AMQ::Client::Async::Entity
- AMQ::Client::Async::EventMachineClient
- AMQ::Client::Async::Exchange
- AMQ::Client::Async::Extensions
- AMQ::Client::Async::Extensions::RabbitMQ
- AMQ::Client::Async::Extensions::RabbitMQ::Basic
- AMQ::Client::Async::Extensions::RabbitMQ::Basic::ChannelMixin
- AMQ::Client::Async::Extensions::RabbitMQ::Basic::ConsumerMixin
- AMQ::Client::Async::Extensions::RabbitMQ::Basic::QueueMixin
- AMQ::Client::Async::Extensions::RabbitMQ::Confirm
- AMQ::Client::Async::Extensions::RabbitMQ::Confirm::ChannelMixin
- AMQ::Client::Async::ProtocolMethodHandlers
- AMQ::Client::Async::Queue
- AMQ::Client::Async::RegisterEntityMixin
- AMQ::Client::BadLengthError
- AMQ::Client::ConnectionClosedError
- AMQ::Client::ConsumerTagGenerator
- AMQ::Client::Framing
- AMQ::Client::Framing::IO
- AMQ::Client::Framing::IO::Frame
- AMQ::Client::Framing::String
- AMQ::Client::Framing::String::Frame
- AMQ::Client::HandlersRegistry
- AMQ::Client::InconsistentDataError
- AMQ::Client::Logging
- AMQ::Client::Logging::IncompatibleLoggerError
- AMQ::Client::MissingHandlerError
- AMQ::Client::NoFinalOctetError
- AMQ::Client::Openable
- AMQ::Client::Openable::ImproperStatusError
- AMQ::Client::PossibleAuthenticationFailureError
- AMQ::Client::ServerNamedEntity
- AMQ::Client::Settings
- AMQ::Client::TCPConnectionFailed
- AMQ::Client::UnknownExchangeTypeError
- AMQ::Protocol
- AMQ::Protocol::GetResponse

No matching classes.

# AMQ::Client::Async::Extensions::RabbitMQ::Basic::ConsumerMixin

### Public Class Methods

included(receiver) click to toggle source

    # File lib/amq/client/async/extensions/rabbitmq/cancel.rb, line 23
    def self.included receiver
      receiver.handle(Protocol::Basic::Cancel) do |connection, method_frame|
        channel      = connection.channels[method_frame.channel]
        basic_cancel = method_frame.decode_payload
        consumer     = channel.consumers[basic_cancel.consumer_tag]

        # Handle the delivery only if the consumer still exists.
        consumer.handle_cancel(basic_cancel) if consumer
      end
    end

### Public Instance Methods

handle_cancel(basic_cancel) click to toggle source

    # File lib/amq/client/async/extensions/rabbitmq/cancel.rb, line 19
    def handle_cancel(basic_cancel)
      self.exec_callback(:scancel, basic_cancel)
    end

on_cancel(&block) click to toggle source

    # File lib/amq/client/async/extensions/rabbitmq/cancel.rb, line 13
    def on_cancel(&block)
      self.append_callback(:scancel, &block)

      self
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.