1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +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);
asyncCall(
function () use ($input): \Generator {
while (($chunk = yield $input->read()) !== null) {
function () use ($input) : \Generator {
while ($this->is_accepting_new_requests && ($chunk = yield $input->read()) !== null) {
/** @var string $chunk */
$this->readMessages($chunk);
if ($this->readMessages($chunk) > 0) {
$this->emit('readMessageGroup');
}
}
$this->emitClose();