[Twisted-Python] sleeping in inlineCallbacks

Tristan Seligmann mithrandi at mithrandi.net
Thu Oct 29 21:26:05 EDT 2009


On Thu, Oct 29, 2009 at 8:38 PM, Brian Granger <ellisonbg.net at gmail.com> wrote:
> One question though - can someone explain the need/usage cases for
> task.Clock and the other things in task?

Clock is a "fake" IReactorTime implementation; as the docstring says,
it is intended for writing unit tests where you want control over the
behaviour of the clock, rather than using the real time source.

As for the other things... LoopingCall repeatedly runs a callable at a
certain interval, coiterate takes a generator and iterates it
cooperatively (returning control back to the reactor between
iterations), and cooperate is a new-and-improved version of coiterate
which I haven't looked at yet.
-- 
mithrandi, i Ainil en-Balandor, a faer Ambar



More information about the Twisted-Python mailing list