Method: MQueue::Queue.publish

Defined in:
lib/m_queue/queue.rb

.publish(msg) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/m_queue/queue.rb', line 35

def publish(msg)
  if defined?(RAILS_ENV) && 
    (RAILS_ENV == 'development' or
      RAILS_ENV == 'test')
        return self.new.on_message(msg)
  end
  send_to_server {|server|
    server[queue_name] = msg.to_yaml
  }
  msg
end