[Buildbot-devel] deferreds from polling change source
gjorge at google.com
Tue Jul 2 01:29:49 UTC 2013
Thanks Tom. This is what I was looking for:
On Thu, Jun 27, 2013 at 4:14 PM, Tom Prince <tom.prince at ualberta.net> wrote:
> Jorge Gonzalez <gjorge at google.com> writes:
> > def poll(self):
> > defered_poll = defer.Deferred()
> > defered_poll.addCallback(lambda _: self.DoTheActualPoll())
> > defered_poll.callback(None)
> > return defered_poll
> `.doTheActualPoll` will just be called when `.callback` is
> called. Deferreds don't magically make something asynchronous, they are
> just a way of organizing callbacks.
> The right way to do this is to change `.doTheActualPoll` to be
> asynchronous. How to do this will depend on what is doing. Anything else
> will cause everything to freeze while it is running.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the devel