[Twisted-Python] LoopingCall and object instances
ladaan at iptel.org
Wed Aug 22 16:59:28 EDT 2007
I found the answer myself here at
I followed the code and implemented to my class start and stop methods
which solved my problem
with taking out object instances from loop testing.
Ladislav Andel wrote:
> 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,
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
More information about the Twisted-Python