Hi guys I'm new to Python and I can't find any approaches to my scenario . How can I start multiple repetitive tasks of the same function, with different parameters, and still have the ability to stop a certain one?
To make things clearer check the image bellow. I have an f(x) function. I want to start multiple independent recurring calls, with different entry data and at a later time stop them separately as well.
description http://happyfacedevs.com/public/python.png
UPDATE: Here's the whole scenario. I have a main function that gets called every 60 secs. This function gets a list of urls and based on some conditions it decides to start the repeating function with the given url or stops an already running one.
def f(x):
#repeat every 5 secs until stopped
#do stuff with x
def mainTask():
#gets a new list of urls
#for every url, start a new repeating task or stop an existing one
#based on some conditions
threading.Timer(60, mainTask).start()
mainTask()
f(a),f(b),f(c)once each and have them run repeatedly until cancelled, or do you simply mean that you want to callf(a),f(b),f(c)and be able to stop any one of them at a later time?