Method: Gilmour::Responder#publish

Defined in:
lib/gilmour/responder.rb

#publish(message, destination, opts = {}, code = nil, &blk) ⇒ Object

Proxy to publish method. See Backend#publish



319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/gilmour/responder.rb', line 319

def publish(message, destination, opts = {}, code=nil, &blk)
  if @multi_process
    if block_given?
      GLogger.error "Publish callback not supported in forked responder. Ignoring!"
    end
    call_parent_backend_method('publish', message, destination, opts, code)
#        method = opts[:method] || 'publish'
#        msg = JSON.generate([method, [message, destination, opts, code]])
#        @write_command_pipe.write(msg+"\n")
#        @write_command_pipe.flush
  elsif block_given?
    @backend.publish(message, destination, opts, &blk)
  else
    @backend.publish(message, destination, opts)
  end
end