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

Issue 18478004: Make Asset.readAsString() async. (Closed)

Created:
7 years, 5 months ago by Bob Nystrom
Modified:
7 years, 5 months ago
Reviewers:
nweiz
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Patch Set 1 #

Patch Set 2 : Rebase. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -26 lines) Patch
M pkg/barback/lib/src/asset.dart View 3 chunks +3 lines, -3 lines 0 comments Download
M pkg/barback/test/utils.dart View 1 4 chunks +33 lines, -23 lines 3 comments Download

Messages

Total messages: 8 (0 generated)
Bob Nystrom
This builds on top of the other barback patch in flight, so you might want ...
7 years, 5 months ago (2013-07-03 00:22:30 UTC) #1
nweiz
On 2013/07/03 00:22:30, Bob Nystrom wrote: > This builds on top of the other barback ...
7 years, 5 months ago (2013-07-03 00:48:12 UTC) #2
Bob Nystrom
On 2013/07/03 00:48:12, nweiz wrote: > On 2013/07/03 00:22:30, Bob Nystrom wrote: > > This ...
7 years, 5 months ago (2013-07-03 17:50:02 UTC) #3
nweiz
One suggestion, otherwise LGTM. https://codereview.chromium.org/18478004/diff/4001/pkg/barback/test/utils.dart File pkg/barback/test/utils.dart (right): https://codereview.chromium.org/18478004/diff/4001/pkg/barback/test/utils.dart#newcode415 pkg/barback/test/utils.dart:415: output += contents; Doing this ...
7 years, 5 months ago (2013-07-03 18:21:07 UTC) #4
Bob Nystrom
Committed patchset #2 manually as r24743 (presubmit successful).
7 years, 5 months ago (2013-07-03 19:44:44 UTC) #5
Bob Nystrom
https://codereview.chromium.org/18478004/diff/4001/pkg/barback/test/utils.dart File pkg/barback/test/utils.dart (right): https://codereview.chromium.org/18478004/diff/4001/pkg/barback/test/utils.dart#newcode415 pkg/barback/test/utils.dart:415: output += contents; On 2013/07/03 18:21:07, nweiz wrote: > ...
7 years, 5 months ago (2013-07-03 19:45:23 UTC) #6
nweiz
https://codereview.chromium.org/18478004/diff/4001/pkg/barback/test/utils.dart File pkg/barback/test/utils.dart (right): https://codereview.chromium.org/18478004/diff/4001/pkg/barback/test/utils.dart#newcode415 pkg/barback/test/utils.dart:415: output += contents; On 2013/07/03 19:45:23, Bob Nystrom wrote: ...
7 years, 5 months ago (2013-07-03 20:11:16 UTC) #7
Bob Nystrom
7 years, 5 months ago (2013-07-03 20:21:03 UTC) #8
Message was sent while issue was closed.
On 2013/07/03 20:11:16, nweiz wrote:
> https://codereview.chromium.org/18478004/diff/4001/pkg/barback/test/utils.dart
> File pkg/barback/test/utils.dart (right):
> 
>
https://codereview.chromium.org/18478004/diff/4001/pkg/barback/test/utils.dar...
> pkg/barback/test/utils.dart:415: output += contents;
> On 2013/07/03 19:45:23, Bob Nystrom wrote:
> > On 2013/07/03 18:21:07, nweiz wrote:
> > > Doing this imperatively seems less clean than the map/join you were doing
> > > before.
> > 
> > I know, but Future.forEach() doesn't actually return the resulting futures
> into
> > some sequence I can aggregate, and Future.wait() doesn't guarantee ordering.
I
> > think this is about the best I can do.
> 
> [Future.wait] had better guarantee ordering; we rely on the ordering all over
> the place. We use the pattern of
> 
>     Future.wait([future1, future2]).then((results) {
>       var result1 = results[0];
>       var result2 = results[1];
>       ...
>     })
> 
> very frequently.

Oh, sorry, yes, of course it does. I was thinking more in terms of:

Future.wait(foo.map(() {
  return new Future().then(() { ...stuff... });
});

In this case, there's no guarantee what order those then bodies will run in.

Powered by Google App Engine
This is Rietveld 408576698