Imagine having a large amount of data that needs to be processed. In this scenario, the processing must happen on the client side rather than the server side. The data processing involves iterating through each element in the data set:
for element in data do:
//perform some actions with each "element"
end
For example, let's assume the dataset data
contains 100,000 elements.
Executing the processing function will cause the entire DOM to freeze until the loop completes. Is there a way to perform this processing in a non-blocking manner? Perhaps using async/await, dividing the data into chunks and utilizing a yield mechanism, or any other method?
EDIT: Web Workers cannot be utilized as IE 11 support is required.
EDIT 2: It appears I was conflating "Web Workers" with "Shared Web Workers". The question has been resolved.