26 lines
656 B
PHP
26 lines
656 B
PHP
<?php
|
|
|
|
namespace danog\MadelineProto\Ipc\Wrapper;
|
|
|
|
use Amp\ByteStream\InputStream as AmpInputStream;
|
|
use Amp\Promise;
|
|
use danog\MadelineProto\Ipc\Wrapper\Obj;
|
|
use danog\MadelineProto\Tools;
|
|
|
|
class InputStream extends Obj implements AmpInputStream
|
|
{
|
|
/**
|
|
* Reads data from the stream.
|
|
*
|
|
* @return Promise Resolves with a string when new data is available or `null` if the stream has closed.
|
|
*
|
|
* @psalm-return Promise<string|null>
|
|
*
|
|
* @throws PendingReadError Thrown if another read operation is still pending.
|
|
*/
|
|
public function read(): Promise
|
|
{
|
|
return Tools::call($this->__call('read'));
|
|
}
|
|
}
|