1
0
mirror of https://github.com/danog/byte-stream.git synced 2024-11-27 12:24:48 +01:00
byte-stream/lib/functions.php
2017-04-26 08:17:19 +02:00

23 lines
571 B
PHP

<?php
namespace Amp\ByteStream;
use Amp\{ Coroutine, Promise };
// @codeCoverageIgnoreStart
if (\strlen('…') !== 3) {
throw new \Error(
'The mbstring.func_overload ini setting is enabled. It must be disabled to use the stream package.'
);
} // @codeCoverageIgnoreEnd
/**
* @param \Amp\ByteStream\ReadableStream $source
* @param \Amp\ByteStream\WritableStream $destination
*
* @return \Amp\Promise
*/
function pipe(ReadableStream $source, WritableStream $destination): Promise {
return new Coroutine(Internal\pipe($source, $destination));
}