Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8356513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:13:12+00:00 2026-06-09T10:13:12+00:00

This may be sort of a newb-ish question. I know you can do this

  • 0

This may be sort of a newb-ish question. I know you can do this kind of thing in Node.js pretty easily, but I don’t know what it’s called and haven’t had much luck with Google.

Basically, I am trying to build a simple tic-tac-toe server with Ruby on Rails. Players connect to each other, and moves are recorded and results processed live. If it was just having the user send messages to the server, that would be easily done with AJAX. However, I want to have the client wait and listen for the server to point out that the other player has made a move, and then automatically respond to that. I could do this by pinging the server with AJAX constantly, but there must be a better way. I feel like I’m missing some big technology that I haven’t found yet just because I’m not entirely sure how to describe it or what it would be called.

Would I want to have the client connect directly to the server and maintain a live connection? If so, how would I do that? If not, what is the better way to do this? How do online games and stock tickers and streaming services provide their content to the client, and what tools does Rails give me to do something similar?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:13:13+00:00Added an answer on June 9, 2026 at 10:13 am

    Check eventmachine in ruby

    some links

    https://github.com/eventmachine/eventmachine/wiki

    http://20bits.com/article/an-eventmachine-tutorial

    http://rubysource.com/introduction-to-event-machine

    There is a faye and private_pub gem which makes things simpler .

    There are railcasts available.

    http://railscasts.com/episodes/260-messaging-with-faye

    http://railscasts.com/episodes/316-private-pub

    I recommend trying private_pub which is built on top on faye which uses eventmachine which can solve most of your questions

    the pub/sub model helps to the client to subscribe to its channel
    , so you can push updated to the channel which will be eventually passed to the client.

    Your question and my answers

    Q. Would I want to have the client connect directly to the server and maintain a live connection? If so, how would I do that?

    A. You can use private_pub or faye to establish long connections and push data
    also Check our later for pusher.com they provide services on commercial basis.

    Q.How do online games and stock tickers and streaming services provide their content to the client, and what tools does Rails give me to do something similar?

    A. AFAIK everyone uses some sort of push technology. pub/sub model. ruby has some gems available for such requirements, faye private_pub some of them..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may be a simple question but I can;t find the answer anywhere. Here
this may sound pretty straight forward, but still I want to post this question
This may be kind of a simple question, but I haven't seen a direct
This may be a bit of an easy, headdesk sort of question, but my
This may be some sort of duplicate of this question . But I've tried
This may be a stupid question but I have a code with the following
This may sound like a very generic question but here it goes. I have
This may seem a bit crazy, but if you can tell me a better
This may be a stupid question, but I'm trying to replicate a customer's OpenLDAP
This may be a terribly naive question but I was just wondering if the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.