When wslink made use of twisted, we had a example that did:
from twisted.internet import task
...
loopTask = task.LoopingCall(callback_method)
loopTask.start(2.0)
and that would schedule callback_method to be called repeatedly every two seconds. We can achieve something similar with just the schedule_callback method in wslink now, but not as simply. It would be nice to provide this capability. A first pass at it might look like:
When wslink made use of twisted, we had a example that did:
and that would schedule
callback_method
to be called repeatedly every two seconds. We can achieve something similar with just theschedule_callback
method in wslink now, but not as simply. It would be nice to provide this capability. A first pass at it might look like:Though it would be nice if the return value was an object with a
cancel()
method, so it behaves like the other scheduling methods.