Search code examples
ruby-on-railsrubysocketsfaye

Rails - Faye pushing data


I dont know how to publish some data from rails server, I would like to do similar like in js

var publication = client.publish('channel', {data});

I found someting like that:

engine.publish(message, channels)

but dont know how to use it


Solution

  • [SOLVED]

    faye_server = Faye::RackAdapter.new(:mount => '/faye', :timeout => 45)
    faye_server.get_client.publish('/foo', data )