joelcarrier/web-slot-machine — Issue #1: long-polling
Author: joelcarrier
Created: 2012-02-05 15:58:18+00:00
State: open

play.html ends with javascript that polls the server for changes in the number of remaining credits.

This polling is currently "throttled" by the server as it holds on to the request for 5 seconds and then responds regardless of whether the number of credits changes.

True long-polling should be implemented where the request is held until a change occurs (up to a maximum timeout of something like 30 seconds).

Also, this could be extended to more than just the state of credits but the entire state of the game. That way initiating a "SPIN" in one window would be reflected in another.