diff --git a/src/Console/Command/WorkerCommand.php b/src/Console/Command/WorkerCommand.php index 2fe40cc6cc4..8b7d4c1061c 100644 --- a/src/Console/Command/WorkerCommand.php +++ b/src/Console/Command/WorkerCommand.php @@ -18,6 +18,7 @@ use Rector\Parallel\Enum\Action; use Rector\Parallel\Enum\ReactCommand; use Rector\Parallel\Enum\ReactEvent; +use Rector\Parallel\Enum\StreamFormat; use Rector\Parallel\ValueObject\Bridge; use Rector\StaticReflection\DynamicSourceLocatorDecorator; use Rector\Util\MemoryLimiter; @@ -79,7 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $input, $output ): void { - $inDecoder = new Decoder($connection, true, 512, JSON_INVALID_UTF8_IGNORE); + $inDecoder = new Decoder($connection, true, StreamFormat::DEPTH, JSON_INVALID_UTF8_IGNORE, StreamFormat::MAX_LENGTH); $outEncoder = new Encoder($connection, JSON_INVALID_UTF8_IGNORE); $outEncoder->write([ diff --git a/src/Parallel/Application/ParallelFileProcessor.php b/src/Parallel/Application/ParallelFileProcessor.php index e0331571938..88f596b27f3 100644 --- a/src/Parallel/Application/ParallelFileProcessor.php +++ b/src/Parallel/Application/ParallelFileProcessor.php @@ -18,6 +18,7 @@ use Rector\Parallel\Enum\Content; use Rector\Parallel\Enum\ReactCommand; use Rector\Parallel\Enum\ReactEvent; +use Rector\Parallel\Enum\StreamFormat; use Rector\Parallel\ValueObject\Bridge; use Rector\Parallel\ValueObject\ParallelProcess; use Rector\Parallel\ValueObject\ProcessPool; @@ -82,7 +83,7 @@ public function process( $this->processPool = new ProcessPool($tcpServer); $tcpServer->on(ReactEvent::CONNECTION, function (ConnectionInterface $connection) use (&$jobs): void { - $inDecoder = new Decoder($connection, true, 512, 0, 4 * 1024 * 1024); + $inDecoder = new Decoder($connection, true, StreamFormat::DEPTH, 0, StreamFormat::MAX_LENGTH); $outEncoder = new Encoder($connection); $inDecoder->on(ReactEvent::DATA, function (array $data) use (&$jobs, $inDecoder, $outEncoder): void { diff --git a/src/Parallel/Enum/StreamFormat.php b/src/Parallel/Enum/StreamFormat.php new file mode 100644 index 00000000000..f598d73e2ed --- /dev/null +++ b/src/Parallel/Enum/StreamFormat.php @@ -0,0 +1,12 @@ +