mirror of
https://github.com/danog/byte-stream.git
synced 2024-11-27 04:14:49 +01:00
Stream → ByteStream
Avoid confusion with Amp\Stream.
This commit is contained in:
parent
772a5e3c7a
commit
e72bc00605
@ -4,7 +4,7 @@ namespace Amp\Stream;
|
||||
|
||||
use AsyncInterop\Promise;
|
||||
|
||||
interface Stream {
|
||||
interface ByteStream {
|
||||
/**
|
||||
* Determines if the stream is readable.
|
||||
*
|
@ -10,7 +10,7 @@ use AsyncInterop\Promise;
|
||||
* the buffer. This class by itself is not particularly useful, but it can be extended to add functionality upon reading
|
||||
* or writing, as well as acting as an example of how stream classes can be implemented.
|
||||
*/
|
||||
class MemoryStream implements Stream {
|
||||
class MemoryStream implements ByteStream {
|
||||
/** @var \Amp\Stream\Buffer */
|
||||
private $buffer;
|
||||
|
||||
|
@ -13,13 +13,12 @@ if (\strlen('…') !== 3) {
|
||||
} // @codeCoverageIgnoreEnd
|
||||
|
||||
/**
|
||||
* @param \Amp\Stream\Stream $source
|
||||
* @param \Amp\Stream\Stream $destination
|
||||
* @param \Amp\Stream\ByteStream $source
|
||||
* @param \Amp\Stream\ByteStream $destination
|
||||
* @param int|null $bytes
|
||||
*
|
||||
* @return \AsyncInterop\Promise
|
||||
*/
|
||||
function pipe(Stream $source, Stream $destination, int $bytes = null): Promise {
|
||||
return new Coroutine(__doPipe($source, $destination, $bytes));
|
||||
}
|
||||
|
||||
@ -43,4 +42,5 @@ function __doPipe(Stream $source, Stream $destination, int $bytes = null): \Gene
|
||||
} while ($source->isReadable() && $destination->isWritable());
|
||||
|
||||
return $written;
|
||||
function pipe(ByteStream $source, ByteStream $destination, int $bytes = null): Promise {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user