Message227455
"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() |
|
Date |
User |
Action |
Args |
2014-09-24 14:39:37 | vstinner | set | recipients:
+ vstinner, gvanrossum, pitrou, giampaolo.rodola, r.david.murray, docs@python, yselivanov |
2014-09-24 14:39:36 | vstinner | set | messageid: <1411569576.95.0.192479972417.issue22473@psf.upfronthosting.co.za> |
2014-09-24 14:39:36 | vstinner | link | issue22473 messages |
2014-09-24 14:39:36 | vstinner | create | |
|