I have a simple blinking light in the background on my NRF52840 board. It blinks every like 1 second. But when i'm waiting for one of my promises to resolve the blinking light seems to be not working.
So do promises block the thread?
It actually might be the fact that my task is running a little longer then i first thought. So i'm guessing until my main task is finished or is halted by a promises. A set timeout won't trigger?
So Espruino can only run one bit of code at a time (it's not pre-emptive), but by splitting the code up and calling the next bit of code from a promise/callback it can then interleave those smaller bits of code and make it seem multi-tasking.
So in your case as you noted I think maybe one part of the promise is just taking a long time to finish?
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem