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

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -