arnauorriols / node-red-contrib-python-function

Write Python functions in Node-RED!
MIT License
41 stars 23 forks source link

Threading is not working ???? #5

Closed krambriw closed 3 years ago

krambriw commented 7 years ago

This simple code is not working:

from threading import Timer

def wakeUpCall():
    node.warn('time to wake up')

t = Timer(5.0, wakeUpCall)
t.start()
node.warn('waiting for timer to fire')
arnauorriols commented 4 years ago

It does work. As in #10 , remember that an input message is necessary to trigger the code. You can have a dummy trigger that triggers automatically at boot if you just want to run the Python code...

lorenzanaj commented 4 years ago

I can confirm this works with at least with my stepper motor task. 2 simple threads were spawned, did some gpio/driver type things and joined and completed fine.