Skip to content

Instantly share code, notes, and snippets.

@ktkaushik
Created November 15, 2012 06:16
Show Gist options
  • Select an option

  • Save ktkaushik/4076939 to your computer and use it in GitHub Desktop.

Select an option

Save ktkaushik/4076939 to your computer and use it in GitHub Desktop.
Faye pub/sub for rails
It uses WebSocket, EventSource, or HTTP polling to establish a persistent connection between every client on the server. It uses the best network transport available in the user's browser. The server's job is to accept messages from clients and route them to other clients based on the channels that each client is subscribed to. If a client has a socket connection, the message is pushed immediately. If it has an HTTP connection, the message is queued on the server and returned the next time the client sends a polling request -- this makes sure that clients don't drop messages while they are not connected to the server.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment