1
0
mirror of https://github.com/danog/amp.git synced 2024-11-26 20:15:00 +01:00

Squash leftover Stream references

This commit is contained in:
Aaron Piotrowski 2017-04-27 11:18:25 -05:00 committed by Niklas Keller
parent 9a2a4966c6
commit 45481a710c
5 changed files with 5 additions and 5 deletions

View File

@ -31,7 +31,7 @@ Loop::run(function () {
Promise\rethrow(new Coroutine($generator($emitter)));
while (yield $iterator->advance()) {
printf("Stream emitted %d\n", $iterator->getCurrent());
printf("Emitter emitted %d\n", $iterator->getCurrent());
yield new Pause(500); // Listener consumption takes 500 ms.
}
} catch (\Exception $exception) {

View File

@ -29,7 +29,7 @@ Loop::run(function () {
$iterator = $emitter->getIterator();
while (yield $iterator->advance()) {
printf("Stream emitted %d\n", $iterator->getCurrent());
printf("Emitter emitted %d\n", $iterator->getCurrent());
yield new Delayed(100); // Listener consumption takes 100 ms.
}
} catch (\Throwable $exception) {

View File

@ -24,7 +24,7 @@ Loop::run(function () {
});
while (yield $iterator->advance()) {
printf("Stream emitted %d\n", $iterator->getCurrent());
printf("Producer emitted %d\n", $iterator->getCurrent());
yield new Delayed(100); // Listener consumption takes 100 ms.
}
} catch (\Exception $exception) {

View File

@ -84,7 +84,7 @@ try {
* prevent IDEs and other tools from reporting multiple definitions.
*/
eval('namespace Amp;
final class Emitter implements Stream {
final class Emitter implements Iterator {
use Internal\Producer { emit as public; complete as public; fail as public; }
public function getIterator(): Iterator { return $this; }
}');

View File

@ -3,7 +3,7 @@
namespace Amp;
/**
* Defines an asynchronous stream that is designed to be used within a coroutine.
* Defines an asynchronous iterator over a set of values that is designed to be used within a coroutine.
*/
interface Iterator {
/**