Still relatively new to Node and it's non-blocking nature.
I have written an API module for the backend of a desired desktop application I want to make. When each method is called, it returns an object. Two examples are below.
{ success: 1, response: RESPONSE }
{ success: 0, msg: ERROR_MSG }
1 being a successful operation, 0 not.
What I want to do is now start linking the backend API to a main program. I want to call a function from the module and if my success code is 1, move on to the next operation, if 0 wait a desired time (1000ms) and retry the operation, all whilst not blocking the event loop.
Thanks.