ajax-polling

How to Build Multiplayer Online Boardgames? What to Research?

I want to build a multiplayer online boardgame like monopoly using php, mysql. I want to run the game in the browser. Multiple people connect to the game, then each person takes turn rolling the die, making trades etc... I was curious how other game developers achieve the "turn base" functionality in real-time. Does the client browser...

User Presence In a chat room (chat getting updated by simple polling)

We have implemented a simple chat room feature in Rails using Simple Ajax updates. Now in every chat room a message belongs to particular user. We want to show the list of users(something like user presence). Please suggest ways. We are not using Jabber,XMPP etc. The Chatroom model is: class ChatRoom < ActiveRecord::Base validates_p...

WebSphere Application Server Feature Pack for Web 2.0

We are in the process of doing a POC on AJAX push technology. Some of the things we are looking at are Ice Faces Push Technology, Richfaces a4j:push and WebSphere Application Server Feature Pack for Web 2.0. We find an issue with WebSphere Application Server Feature Pack for Web 2.0 in that going down this road we become a slave to th...

Javascript Poll server. Will this cause a stack overflow?

I am not too familiar with the specifics of every javascript implementation on each browser. I do know however that using setTimeout, the method passed in gets called on a separate thread. So would using a setTimeout recursively inside of a method cause its stack to grow indefinitely until it causes a Stack Overflow? Or would it create a...

Online users in Ruby on Rails

What is the simplest way how to check if user is online and display list of online users? The only way I can think of is some periodic polling server to update last action timestamp, and when last timestamp is more than xx ago, user is considered to be offline. But it doesn't seem like too eficient solution. ...

Trying to call a function every 3 minutes using javascript

I have a function that returns an integer (the current reputation score for a user on a community site). That number is often going up or down based on how their comments and submissions are voted on. I'd like to "poll" it every 30 seconds or so to see if it's changed, and if so, update the number that I'm displaying. In another Stack...

close long poll connection, jQuery-ajax

Background I use a Tornado-like server with support for long-polls. Each web pages a user clicks around to sets up a long poll to the server like this: $.ajax({ type: 'GET', url: "/mylongpollurl/", dataType: 'application/json', success: function(json) { // I do stuff here }, error: function(xhr, errText, ...

ajax: don't wait for response, but check for it periodically

I have a PHP process that takes a long time to run. I don't want the AJAX process that calls it to wait for it to finish. When the PHP process finishes it will set a field in a database. There should be some kind of AJAX polling call to check on the database field periodically and set a message. How do I set up a jQuery AJAX call to po...

jQuery: pass different data to periodicalupdater each time?

Hi, On my setup, the ids of all entries will be fetched (e.g. assigned to variable ids=2,5,7,9,11) and passed to periodicalupdater to send to a php script. The problem is that the list of ids change over time, when new entries are added via ajax. How can I make it such that the updated id list of entries will be passed to periodicalupda...

how to detect incoming chat message?

I'm using PHP, AJAX, a MySQL database, and a lot of jQuery to prototype web-based chat system (similar to Facebook Chat). I'm stuck on how to "listen" for incoming chats... when to know someone is trying to chat me... and to know that it is a new chat, not an existing chat. Right now, I'm polling to see if there has been new insertions ...

how to trigger an event whenever a tweet is updated

I wanted to know how to trigger an event (say. storing a tweet from a particular user in a text file or mailing it etc.) when a particular user updates his tweets. Do we need to poll for the updates every few seconds or is there any other way out. ...

How best to implement the polling consumer pattern in JavaScript

Background Back in May I reported an issue on WebKit regarding a memory retention issue. It looks as though the problem could be due to the Web Inspector itself, but I'm not convinced yet. Problem A problem surfaced whereby my JavaScript application implements a "Polling Consumer" pattern for obtaining data as it becomes available. Th...