Sha256: 278d256981fc7bd753b697845f02cbb7d63e4e218a5e21d95105fc5f08489e89

Contents?: true

Size: 814 Bytes

Versions: 16

Compression:

Stored size: 814 Bytes

Contents

# encoding: utf-8

module Bunny
  class Channel < Qrack::Channel

    def initialize(client)
      super
    end

    def open
      client.channel = self
      client.send_frame(Qrack::Protocol::Channel::Open.new)

      method = client.next_method

      client.check_response(method, Qrack::Protocol::Channel::OpenOk, "Cannot open channel #{number}")

      @active = true
      :open_ok
    end

    def close
      client.channel = self
      client.send_frame(Qrack::Protocol::Channel::Close.new(:reply_code => 200, :reply_text => 'bye', :method_id => 0, :class_id => 0))

      method = client.next_method

      client.check_response(method, Qrack::Protocol::Channel::CloseOk, "Error closing channel #{number}")

      @active = false
      :close_ok
    end

    def open?
      active
    end

  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
bunny-0.7.13 lib/bunny/channel08.rb
bunny-0.7.12 lib/bunny/channel08.rb
bunny-0.7.11 lib/bunny/channel08.rb
bunny-0.7.10 lib/bunny/channel08.rb
bunny-0.8.0 lib/bunny/channel.rb
sparqcode_bunny-0.0.2 lib/bunny/channel08.rb
bunny-0.7.9 lib/bunny/channel08.rb
sparqcode_bunny-0.0.1 lib/bunny/channel08.rb
bunny-0.7.8 lib/bunny/channel08.rb
bunny-0.7.6 lib/bunny/channel08.rb
bunny-0.7.5 lib/bunny/channel08.rb
bunny-0.7.4 lib/bunny/channel08.rb
bunny-0.7.3 lib/bunny/channel08.rb
bunny-0.7.2 lib/bunny/channel08.rb
bunny-0.7.1 lib/bunny/channel08.rb
bunny-0.7 lib/bunny/channel08.rb