Skip to content

Instantly share code, notes, and snippets.

@sgeorgi
sgeorgi / Faye.md
Last active June 28, 2022 16:09
Generating events as Resque/Redis.jobs and publishing them to a faye websocket on the client. This is untested, but copied off a working project's implementation

Pushing data from Server to the Client using Faye, a Resque-Job and some JS

EDIT: Forgot to mention that you need Faye's JS in your client, so just add

<%= javascript_include_tag :defaults, "http://localhost:3000/stream.js" %>

to your application.html.erb!

  1. Start server (and resque-worker) with rails s thin (and rake resque-work).
  2. Go to the index page of your Controller