Question about code execution and the nature of javascript blocking/ non blocking

Basically I have something similar to the code below and I’m not entirely sure what order of execution is always going to happen. Right now I suppose it executes in a non blocking fashion, being But I’ve had times that it’s I have no control over when res.on(‘data’) is called because it is a socket event listener and is handled on a separate server. I guess that I’m afraid that the callback is going to be called in the middle of res.on() is that something that could happen? Say res.on() is right in the middle of execution would the callback