Maybe you could simplify the code and make it always send chunks to Worker. So it could always on this side spit File into chunks. (You need this for nice progress anyway.)