mirror of
https://github.com/danog/byte-stream.git
synced 2024-11-26 20:04:51 +01:00
Drop extending Promise
This commit is contained in:
parent
5e250f7c79
commit
7cc313a633
@ -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();
|
||||
}
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user