Problem. I send on the server function. It can be anything (for example, a function with an infinite loop came to the server, it is clear that everything will become. The question is how to avoid it? Ie, for example, set a timeout for which the server will forcefully respond to the request and terminate the cycle.

  • Most likely, this is impossible. Javascript is a single-threaded language, and you can interrupt an infinite loop only by stopping the process. - Pavel Mayorov

0