Sha256: a137bb6f3b26a6681b4a07ad140f7818958f2c61227fc970afc7fedbfa1c3057

Contents?: true

Size: 769 Bytes

Versions: 10

Compression:

Stored size: 769 Bytes

Contents

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

10 entries across 10 versions & 2 rubygems

Version Path
sidekick-client-0.2.5 lib/ext/bunny-0.6.0/lib/bunny/channel08.rb
bunny-0.6.3.rc2 lib/bunny/channel08.rb
bunny-0.6.3.rc1 lib/bunny/channel08.rb
sidekick-client-0.2.4 lib/ext/bunny-0.6.0/lib/bunny/channel08.rb
sidekick-client-0.2.3 lib/ext/bunny-0.6.0/lib/bunny/channel08.rb
sidekick-client-0.2.2 lib/ext/bunny-0.6.0/lib/bunny/channel08.rb
sidekick-client-0.2.1 lib/ext/bunny-0.6.0/lib/bunny/channel08.rb
sidekick-client-0.2.0 lib/ext/bunny-0.6.0/lib/bunny/channel08.rb
sidekick-client-0.1.0 lib/ext/bunny-0.6.0/lib/bunny/channel08.rb
bunny-0.6.0 lib/bunny/channel08.rb