Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Stream.merge() #9778

Closed
alxhub opened this issue Apr 8, 2013 · 6 comments
Closed

FR: Stream.merge() #9778

alxhub opened this issue Apr 8, 2013 · 6 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant core-2 library-async P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@alxhub
Copy link

alxhub commented Apr 8, 2013

dart:async should have an easy way to combine multiple streams into one.

Example implementation which supports pause/resume.

Stream merge(List<Stream> streams) {
  int _open = streams.length;
  var c = new StreamController();
  for (var stream in streams) {
    stream.listen(c.add)
         ..onError(c.addError)
         ..onDone(() {
      if (--_open == 0) {
        c.close();
      }
    });
  }
  return c.stream;
}

@alxhub
Copy link
Author

alxhub commented Apr 8, 2013

Whoops, that should be "doesn't support pause/resume"

@lrhn
Copy link
Member

lrhn commented Apr 9, 2013

Added Area-Library, Library-Async, Triaged labels.

@lrhn
Copy link
Member

lrhn commented Aug 16, 2013

Removed Type-Defect label.
Added Type-Enhancement label.

@lrhn
Copy link
Member

lrhn commented Aug 28, 2013

Issue #12218 has been merged into this issue.


cc @floitschG.

@alxhub alxhub added Type-Enhancement area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-async labels Aug 28, 2013
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed triaged labels Feb 29, 2016
@zoechi
Copy link
Contributor

zoechi commented Jul 18, 2016

@lrhn
Copy link
Member

lrhn commented Jul 25, 2016

Seems like StreamGroup.merge from package:async handles this problem now.

@lrhn lrhn added the core-m label Aug 11, 2017
@floitschG floitschG added core-2 and removed core-m labels Aug 29, 2017
@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant core-2 library-async P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants