G
G
gohellp2021-04-22 22:48:39
Node.js
gohellp, 2021-04-22 22:48:39

How to make a permanent condition check without pausing the code?

I tried to check through an infinite loop in the main file (I know, stupidly, but this is the only thing that came to mind then). I was looking for something like this on the Internet, but I didn’t find anything (or I just didn’t scroll through the Google pages). So far, the only idea in my head is to make a separate file with this check through a loop.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2021-04-22
@gohellp

Move your validation to a separate thread. There, through setInterval, perform a check and, according to some condition, send a message to the parent thread. And in the parent thread, subscribe and wait for the event.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question