Module: AMQP

Included in:
MQ, MQ::Exchange, MQ::Queue
Defined in:
lib/amqp/spec.rb,
lib/amqp.rb,
lib/amqp/spec.rb,
lib/amqp/frame.rb,
lib/amqp/buffer.rb,
lib/amqp/client.rb,
lib/amqp/protocol.rb

Overview

this file was autogenerated on Sun Jul 20 04:06:05 -0700 2008 using amqp-0.8.json (mtime: Wed Jul 16 12:10:42 -0700 2008)

DO NOT EDIT! (edit protocol/codegen.rb instead, and run ‘rake codegen`)

Defined Under Namespace

Modules: BasicClient, Client, Protocol Classes: Buffer, Error, Frame

Constant Summary collapse

VERSION =
'0.5.5'
DIR =
File.expand_path(File.dirname(File.expand_path(__FILE__)))
HEADER =
"AMQP".freeze
VERSION_MAJOR =
8
VERSION_MINOR =
0
PORT =
5672
RESPONSES =
{
  200 => :REPLY_SUCCESS,
  310 => :NOT_DELIVERED,
  311 => :CONTENT_TOO_LARGE,
  312 => :NO_ROUTE,
  313 => :NO_CONSUMERS,
  403 => :ACCESS_REFUSED,
  404 => :NOT_FOUND,
  405 => :RESOURCE_LOCKED,
  406 => :PRECONDITION_FAILED,
  320 => :CONNECTION_FORCED,
  402 => :INVALID_PATH,
}
FIELDS =
[
  :bit,
  :long,
  :longlong,
  :longstr,
  :octet,
  :short,
  :shortstr,
  :table,
  :timestamp,
]

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggingObject

Returns the value of attribute logging.



16
17
18
# File 'lib/amqp.rb', line 16

def logging
  @logging
end

Class Method Details

.clientObject



48
49
50
# File 'lib/amqp/client.rb', line 48

def self.client
  @client ||= BasicClient
end

.client=(mod) ⇒ Object



52
53
54
55
# File 'lib/amqp/client.rb', line 52

def self.client= mod
  mod.__send__ :include, AMQP
  @client = mod
end

.connect(*args) ⇒ Object



19
20
21
# File 'lib/amqp.rb', line 19

def self.connect *args
  Client.connect *args
end

.settingsObject



23
24
25
26
27
28
29
30
# File 'lib/amqp.rb', line 23

def self.settings
  @settings ||= {
    :user => 'guest',
    :pass => 'guest',
    :vhost => '/',
    :logging => false
  }
end

.start(*args) ⇒ Object



32
33
34
# File 'lib/amqp.rb', line 32

def self.start *args
  @conn ||= connect *args
end

.stopObject



36
37
38
39
40
41
42
43
# File 'lib/amqp.rb', line 36

def self.stop
  if @conn
    @conn.close{
      yield if block_given?
      @conn = nil
    }
  end
end