1) User clicks save
2) Increase the queue number
3) Pass the job to the web worker
4) After the webworker done saving with the item, decrease queue and increase completed
In this prototype, however, I hard coded the text variable, that actually should receive the value from a textarea of a form, because I cannot find a solution to pass the value to the web worker. On the other hand, the result was almost there - the queue and completed can increase and decrease based on the web worker. The number of saves clicked and the record number in the database are equals. There is no lags even when the user made quick clicks.
Without the web worker (AJAX only) user can click as many times as he wants, but there will be a lag. Nevertheless, the number of records in database and clicks are equals.
Some how it proved the concept, but it might not necessarily work. Another alternative will be to use the web worker as a queue manager.
75682-100725-673958-46
© 2010 All Rights Reserved.
No comments:
Post a Comment