Multitasking?
Posted: Thu Nov 02, 2017 9:07 am
Hi!
I always write my code in this way: doing everything from timers.
I mean my main.py is launched at boot initializes everything it has to, launches a few timers that will do periodic tasks (e.g start the pump to water the plants) and then terminates.
I find very convenient to do so because I do not have a program running continuously in a loop and therefore I can communicate with the system thru webrepl.
I communicate with the system and at the same time the timers will launch the tasks they have to. It works well even with timers doing tasks very often (e.g every seconds).
So it’s a king of multitasking...
Is there anything wrong with that?
Thks
--
Jmp0
I always write my code in this way: doing everything from timers.
I mean my main.py is launched at boot initializes everything it has to, launches a few timers that will do periodic tasks (e.g start the pump to water the plants) and then terminates.
I find very convenient to do so because I do not have a program running continuously in a loop and therefore I can communicate with the system thru webrepl.
I communicate with the system and at the same time the timers will launch the tasks they have to. It works well even with timers doing tasks very often (e.g every seconds).
So it’s a king of multitasking...
Is there anything wrong with that?
Thks
--
Jmp0