Parent

Methods

AMQP::RPC::Server

@private

Public Class Methods

new(channel, queue_name, impl) click to toggle source
     # File lib/amqp/deprecated/rpc.rb, line 131
131:       def initialize(channel, queue_name, impl)
132:         @channel  = channel
133:         @exchange = AMQP::Exchange.default(@channel)
134:         @queue    = @channel.queue(queue_name)
135:         @impl     = impl
136: 
137:         @handlers     = Hash.new
138:         @id           = "client_identifier_#{rand(1_000_000)}"
139: 
140:         @queue.subscribe(:ack => true) do |header, payload|
141:           selector, *args = Marshal.load(payload)
142:           result = @impl.__send__(selector, *args)
143: 
144:           respond_to(header, result) if header.to_hash[:reply_to]
145:           header.ack
146:         end
147:       end

Public Instance Methods

respond_to(header, result) click to toggle source
     # File lib/amqp/deprecated/rpc.rb, line 149
149:       def respond_to(header, result)
150:         @exchange.publish(Marshal.dump(result), :message_id => header.message_id, :routing_key => header.reply_to)
151:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.