Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Issue 15942010: Make _FutureImpl._chain do path shortening on listeners. (Closed)

Created:
7 years, 6 months ago by Lasse Reichstein Nielsen
Modified:
7 years, 6 months ago
Reviewers:
floitsch
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Make _FutureImpl._chain do path shortening on listeners. A chained future is one that will give exactly the same result as another future. It is used to handle, e.g., futures returned by .then handlers. Currently we chaing futures by simply making the future itself a listener on the future it is chained to. This change makes the future move all its listeners to the future it is chained to, and forward future listeners as well. It avoids long chains of futures depending on each other. Effectively, chained futures form equivalence classes. This makes the equivalence classess all be represented by the future that every other element depends on, and it applies path shortening to make the dependency graph as flat as possible. R=floitsch@google.com Committed: https://code.google.com/p/dart/source/detail?r=23807

Patch Set 1 #

Total comments: 1

Patch Set 2 : Address cyclic future dependencies #

Patch Set 3 : Now complete with error if there are cyclic dependencies. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+177 lines, -55 lines) Patch
M sdk/lib/async/future_impl.dart View 1 2 6 chunks +124 lines, -18 lines 0 comments Download
M tests/lib/async/future_test.dart View 1 2 36 chunks +53 lines, -37 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Lasse Reichstein Nielsen
7 years, 6 months ago (2013-06-04 07:21:00 UTC) #1
floitsch
LGTM, but I would like to see a solution for the recursion case. https://codereview.chromium.org/15942010/diff/1/sdk/lib/async/future_impl.dart File ...
7 years, 6 months ago (2013-06-06 13:33:45 UTC) #2
Lasse Reichstein Nielsen
Recursion is a problem. The example works, because it just creates the cyclic dependency, but ...
7 years, 6 months ago (2013-06-10 06:09:41 UTC) #3
Lasse Reichstein Nielsen
Cyclic dependencies detected. Should we throw instead of ignoring it? It's a silly error, but ...
7 years, 6 months ago (2013-06-10 06:18:07 UTC) #4
Lasse Reichstein Nielsen
Now reporting an error in case of a cyclic dependency. PTAL.
7 years, 6 months ago (2013-06-10 12:13:53 UTC) #5
floitsch
LGTM.
7 years, 6 months ago (2013-06-10 12:24:37 UTC) #6
Lasse Reichstein Nielsen
7 years, 6 months ago (2013-06-10 12:27:58 UTC) #7
Message was sent while issue was closed.
Committed patchset #3 manually as r23807 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698