1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Update ProtocolStreamReader

This commit is contained in:
Aaron Piotrowski 2019-02-06 12:01:22 -06:00 committed by Matthew Brown
parent 7249539fc6
commit e6fcb79392

View File

@ -42,10 +42,12 @@ class ProtocolStreamReader implements ProtocolReader
{ {
$input = new ResourceInputStream($input); $input = new ResourceInputStream($input);
asyncCall( asyncCall(
function () use ($input): \Generator { function () use ($input) : \Generator {
while (($chunk = yield $input->read()) !== null) { while ($this->is_accepting_new_requests && ($chunk = yield $input->read()) !== null) {
/** @var string $chunk */ /** @var string $chunk */
$this->readMessages($chunk); if ($this->readMessages($chunk) > 0) {
$this->emit('readMessageGroup');
}
} }
$this->emitClose(); $this->emitClose();