title: In browser FIFO queues using Javascript and AJAX to Web Service
body: <p>I have an existing Adobe AIR application that I have been asked to look into converting to a pure HTML5 app that is browser only.</p>
  
  <p>The application is for scoring images of scanned student work.  The AIR app receives config information about what subject to score and then calls a web service which returns an XML message of individual items to be scored (the server handles things like locking items so only one person can score it at a time).  The app then queues these incoming items and downloads the images for each in the background.  In the foreground, the user is presented with one or more incoming queued items in a form and enters a score for each.  When they submit, it then takes those scores and places them in an outgoing queue.  The outgoing queue is watched and any outgoing messages are then sent to another web service process that records the score on the server.  The experienced users can often score these very quickly depending on the subject (as fast as one per second), so we make heavy use of caching, often storing tens or even hundreds of items locally at a time.</p>
  
  <p>In looking at HTML5 and it's options for localstorage and web workers, I thought this might be possible.  I have done some research, but I am not too experienced with these new HTML5 features.  I see that web workers are isolated and cannot access localstorage or sessionstorage.  I figured I the incoming and outgoing queues could simply be arrays that I push and pop to, but now it's not so clear.  If I need a process to constantly watch the incoming queue (to keep it full) and the outgoing queue (to keep it empty), it seemed like web workers would be ideal.  But they cannot share data or manage the local storage.</p>
  
  <p>Any thoughts or pointers to get me going in the right direction?  I would have fairly tight control over dictating the browser requirements, so we can use the latest and greatest versions.  The web service can also easily be reconfigured to handle JSON instead of XML.  Thanks.</p>