Intensive Computing Processing

I am writing a web application (weight and weight of large weight) in which the user enters the scales of pallets. When an individual pallet weight is introduced, a series of checks must be carried out to determine if this weight can be accepted. Checks are all relatively trivial in terms of the required calculation cycles; one is not. As far as I understand, JavaScript is single-threaded, which I mean that if the user starts to enter the weight in a different position of the pallet, it will be blocked until the previous weight has been completely processed.

I canโ€™t afford to let the user wait every time he enters a weight (which they donโ€™t need to do at the moment, since the application is not currently doing this last check properly). I am currently thinking about not taking the final step with intensive calculation until all weights have been entered, and the user means this by clicking on the button. However, this will deprive the user of immediate feedback as to what weight originally caused the problem, a problem that several weights can add in, and it will be difficult to figure out if they have to wait until the last.

My Google searches on this topic were somewhat useful, but I am asking here possible ideas for a modern solution to the dilemma. Any suggestions are welcome. The context of the problem can be observed by going to http://terryliittschwager.com/WB/JWB.php and selecting the plane.

+5
source share
2 answers

If you want to do this on the client side, I would recommend a peek at WebWorkers. They work on a separate thread from the main (DOM) JS thread. Not supported in all browsers (of course), but currently supported in Chrome, FF, Safari, and IE 10.

EDIT: MDN for WebWorkers is a good place to start.

+2
source

All Articles