[Twisted-Python] LoopingCall and object instances

Ladislav Andel ladaan at iptel.org
Wed Aug 22 14:14:17 EDT 2007

I have got following code:

hosts = ['google.com','yahoo.com']

for host in hosts:
        c = PingContext(num, host)
        l = task.LoopingCall(c.ping)
        l.start(30.0, False)

I create a few object instances and pinging those hosts every 30 secs.
I will have another loop through LoopingCall, where I will be checking 
dynamically changing list and comparing with already been checking hosts.
If there is a host missing in the list I will delete the object instance 
which is not in the list.
How can I remove it that it will not be anymore called by LoopingCall?
Or how can I add a new object instance to the LoopingCall in case there 
is new host in the list?

Hopefully, it's understandable.

Thank you,

More information about the Twisted-Python mailing list