multithreading - Threading in python flask server -


i trying create thread in flask server , doesnt seem firing. not getting errors either. here code:

t = thread(target=pourdrink, args=(valid_bcm_pin_numbers[0],float(j[1]), mc, total,)) print "turning on 1" t.start 

and i'm calling:

def pourdrink(drink, amount, mc, total):     # long running task here     data = pin_update(drink, 0)     print "sleeping amount " + str(amount)     time.sleep(float(amount)) 

the thing never prints out "sleeping amount" there doing wrong? let me know if need provide more info or code well.

you need call thread.start method:

t.start() 

just referencing not enough.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -