This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients docs@python, giampaolo.rodola, gvanrossum, pitrou, r.david.murray, vstinner, yselivanov
Date 2014-09-24.14:39:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411569576.95.0.192479972417.issue22473@psf.upfronthosting.co.za>
In-reply-to
Content
"But that isn't quite true.  It is the callback associated with the future that is displaying the result and stopping the loop."

I wrote this example to show that setting the result of a future can schedule a callback. I mean something like:

"In this example, the future is used to link slow_operation() to got_result(): when slow_operation() is done, got_result() is called with the result."

The main idea behind Future is to chain callbacks and the link is done externally. It's different from this design:

    def slow_operation(done_callback):
        ...
        done_callback()
History
Date User Action Args
2014-09-24 14:39:37vstinnersetrecipients: + vstinner, gvanrossum, pitrou, giampaolo.rodola, r.david.murray, docs@python, yselivanov
2014-09-24 14:39:36vstinnersetmessageid: <1411569576.95.0.192479972417.issue22473@psf.upfronthosting.co.za>
2014-09-24 14:39:36vstinnerlinkissue22473 messages
2014-09-24 14:39:36vstinnercreate