Skip to content

Commit 671f1bc

Browse files
committed
merge quiver.streams into quiver.async (fixes google#177)
1 parent abc705c commit 671f1bc

14 files changed

+38
-81
lines changed

README.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ We recommend the following version constraint:
2525

2626
Utilities for working with Futures, Streams and async computations.
2727

28+
`collect` collects the completion events of an `Iterable` of `Future`s into a
29+
`Stream`.
30+
31+
`enumerate` and `concat` represent `Stream` versions of the same-named
32+
[quiver.iterables][] methods.
33+
34+
`doWhileAsync`, `reduceAsync` and `forEachAsync` perform async computations on
35+
the elements of on Iterables, waiting for the computation to complete before
36+
processing the next element.
37+
38+
`StreamBuffer` allows for the orderly reading of elements from a stream, such
39+
as a socket.
40+
2841
`FutureGroup` is collection of Futures that signals when all its child futures
2942
have completed. Allows adding new Futures as long as it hasn't completed yet.
3043
Useful when async tasks can spwn new async tasks and you need to wait for all of
@@ -39,10 +52,6 @@ predicates.
3952
`CountdownTimer` is a simple countdown timer that fires events in regular
4053
increments.
4154

42-
`doWhileAsync`, `reduceAsync` and `forEachAsync` perform async computations on
43-
the elements of on Iterables, waiting for the computation to complete before
44-
processing the next element.
45-
4655
`CreateTimer` and `CreateTimerPeriodic` are typedefs that are useful for
4756
passing Timer factories to classes and functions, increasing the testability of
4857
code that depends on Timer.
@@ -164,19 +173,6 @@ used as a literal match inside of a RegExp.
164173

165174
[quiver.pattern]: http://www.dartdocs.org/documentation/quiver/latest#quiver/quiver-pattern
166175

167-
## [quiver.streams][]
168-
169-
`collect` collects the completion events of an `Iterable` of `Future`s into a
170-
`Stream`.
171-
172-
`enumerate` and `concat` represent `Stream` versions of the same-named
173-
[quiver.iterables][] methods.
174-
175-
`StreamBuffer` allows for the orderly reading of elements from a stream, such
176-
as a socket.
177-
178-
[quiver.streams]: http://www.dartdocs.org/documentation/quiver/latest#quiver/quiver-streams
179-
180176
## [quiver.strings][]
181177

182178
`isBlank` checks if a string is `null`, empty or made of whitespace characters.

lib/async.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,18 @@ library quiver.async;
1616

1717
import 'dart:async';
1818

19+
import 'package:quiver/iterables.dart' show IndexedValue;
1920
import 'package:quiver/time.dart';
2021

22+
part 'src/async/collect.dart';
2123
part 'src/async/countdown_timer.dart';
24+
part 'src/async/concat.dart';
25+
part 'src/async/enumerate.dart';
2226
part 'src/async/future_group.dart';
2327
part 'src/async/future_stream.dart';
2428
part 'src/async/iteration.dart';
2529
part 'src/async/metronome.dart';
30+
part 'src/async/stream_buffer.dart';
2631
part 'src/async/stream_router.dart';
2732

2833
/**

lib/src/streams/collect.dart renamed to lib/src/async/collect.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
part of quiver.streams;
15+
part of quiver.async;
1616

1717
/**
1818
* Returns a stream of completion events for the input [futures].

lib/src/streams/concat.dart renamed to lib/src/async/concat.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
part of quiver.streams;
15+
part of quiver.async;
1616

1717
/**
1818
* Returns the concatentation of the input streams.

lib/src/streams/enumerate.dart renamed to lib/src/async/enumerate.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
part of quiver.streams;
15+
part of quiver.async;
1616

1717
/**
1818
* Returns a [Stream] of [IndexedValue]s where the nth value holds the nth

lib/src/streams/streambuffer.dart renamed to lib/src/async/stream_buffer.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
part of quiver.streams;
15+
part of quiver.async;
1616

1717
/**
1818
* Underflow errors happen when the socket feeding a buffer is finished while

lib/streams.dart

Lines changed: 0 additions & 23 deletions
This file was deleted.

test/all_tests.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import 'io_test.dart' as io;
2323
import 'iterables/all_tests.dart' as iterables;
2424
import 'mirrors_test.dart' as mirrors;
2525
import 'pattern/all_tests.dart' as pattern;
26-
import 'streams/all_tests.dart' as streams;
2726
import 'strings_test.dart' as strings;
2827
import 'testing/all_tests.dart' as testing;
2928
import 'time/all_tests.dart' as time;
@@ -38,7 +37,6 @@ main() {
3837
iterables.main();
3938
mirrors.main();
4039
pattern.main();
41-
streams.main();
4240
strings.main();
4341
testing.main();
4442
time.main();

test/async/all_tests.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,28 @@
1414

1515
library quiver.async.all_tests;
1616

17+
import 'collect_test.dart' as collect;
18+
import 'concat_test.dart' as concat;
1719
import 'countdown_timer_test.dart' as countdown_timer;
1820
import 'create_timer_test.dart' as create_timer;
21+
import 'enumerate_test.dart' as enumerate;
1922
import 'future_group_test.dart' as future_group;
2023
import 'future_stream_test.dart' as future_stream;
2124
import 'iteration_test.dart' as iteration;
2225
import 'metronome_test.dart' as metronome;
26+
import 'stream_buffer_test.dart' as stream_buffer;
2327
import 'stream_router_test.dart' as stream_router;
2428

2529
main() {
30+
collect.main();
31+
concat.main();
2632
countdown_timer.main();
2733
create_timer.main();
34+
enumerate.main();
2835
future_group.main();
2936
future_stream.main();
3037
metronome.main();
3138
iteration.main();
39+
stream_buffer.main();
3240
stream_router.main();
3341
}

test/streams/collect_test.dart renamed to test/async/collect_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
library quiver.streams.collect_test;
15+
library quiver.async.collect_test;
1616

1717
import 'dart:async';
1818
import 'dart:math';
1919

2020
import 'package:test/test.dart';
21-
import 'package:quiver/streams.dart';
21+
import 'package:quiver/async.dart';
2222

2323
main() {
2424
group('collect', () {

test/streams/concat_test.dart renamed to test/async/concat_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
library quiver.streams.concat_test;
15+
library quiver.async.concat_test;
1616

1717
import 'dart:async';
1818

1919
import 'package:test/test.dart';
20-
import 'package:quiver/streams.dart';
20+
import 'package:quiver/async.dart';
2121

2222
main() {
2323
group('concat', () {

test/streams/enumerate_test.dart renamed to test/async/enumerate_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
library quiver.streams.enumerate_test;
15+
library quiver.async.enumerate_test;
1616

1717
import 'dart:async';
1818

1919
import 'package:test/test.dart';
20-
import 'package:quiver/streams.dart';
20+
import 'package:quiver/async.dart';
2121

2222
main() {
2323
group('enumerate', () {

test/streams/streambuffer_test.dart renamed to test/async/stream_buffer_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
library quiver.streams.streambuffer_test;
15+
library quiver.async.stream_buffer_test;
1616

1717
import 'dart:async';
1818
import 'package:test/test.dart';
19-
import 'package:quiver/streams.dart';
19+
import 'package:quiver/async.dart';
2020

2121
void main() {
2222
group("StreamBuffer", () {

test/streams/all_tests.dart

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)