1
0
mirror of https://github.com/danog/byte-stream.git synced 2024-11-26 11:54:54 +01:00

Drop extending Promise

This commit is contained in:
Aaron Piotrowski 2017-04-13 09:04:56 -05:00
parent 5e250f7c79
commit 7cc313a633
2 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@ use Amp\{ Deferred, Listener, Promise, Stream, Success };
* // Immediately use $chunk, reducing memory consumption since the entire message is never buffered.
* }
*/
class Message implements ReadableStream {
class Message implements ReadableStream, Promise {
const LISTENING = 0;
const BUFFERING = 1;
const WAITING = 2;
@ -64,7 +64,7 @@ class Message implements ReadableStream {
/**
* {@inheritdoc}
*/
public function advance(): Promise {
public function wait(): Promise {
if ($this->listener) {
return $this->listener->advance();
}

View File

@ -4,14 +4,14 @@ namespace Amp\ByteStream;
use Amp\Promise;
interface ReadableStream extends Promise {
interface ReadableStream {
/**
* Returns a promise that resolves with a boolean, true if there is another chunk available, false if the stream
* has ended.
*
* @return bool
*/
public function advance(): Promise;
public function wait(): Promise;
/**
* Gets the current chunk that arrived on the stream.