I will have a web worker to parse huge text file (200000 lines, simple syntax though). I expect user to submit that file wia drag'n'drop or otherwise, obtaining a File
object:
var work = new Worker("parser.js")
document.addEventListener("drop", function(e) {
e.preventDefault();
var dt = e.dataTransfer;
var files = dt.files;
if(files.length>0) {
var firstFile = files[0]
var reader = new FileReader();
//SEND FILE TO WORKER?
}
});
I heard of Transferable objects. Is there a way to transfer file to Worker? In a way that GUI thread will not be slowed by reading the file?