Then following occurs frequently:
someAsynchOp(a,b,theRestOfMyCode);
function theRestOfMyCode(){
//several hundred lines of code making up the rest of the file
}
This works perfectly fine. However it is ugly and decreases human readability.
How can I make the Asynchronous operation behave as though it is synchronous or blocking? To avoid needing to wrap the remainder of my file in the function?
I understand why you almost always want to let asynchronous run asynchronous; but there are use cases where there are in fact no lines would want to execute prior to the asynchronous code finishing, and therefore relying on the above structure is probably unnecessarily clunky and hard to read.