[Buildbot-devel] BuildStep: Calling a function repeatedly until it returns correct value

Dustin J. Mitchell dustin at v.igoro.us
Tue Nov 20 14:40:43 UTC 2012


On Tue, Nov 20, 2012 at 7:26 AM, Edward Ekelund <edward.ekelund at axis.com> wrote:
> I feel it shouldn't be that difficult. Does anyone here know of a good
> solution to my problem?

There's no cookbook answer to this.  Assuming that the place where
you're doing this accepts a Deferred, the solution is to return a
Deferred and use reactor.callLater as Pierre has suggested to start
polling.  Once a result is in hand, callback the deferred with that
result.

Another option is to use reactor.deferToThread.  Then you can do all
the blocking stuff you want in the thread.

Dustin




More information about the devel mailing list