1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Ignore range issues with serialised message

This commit is contained in:
Brown 2019-05-30 13:50:00 -04:00
parent f9b509a210
commit 76bdfb7c7b

View File

@ -133,11 +133,7 @@ class Pool
$task_result = $task_closure($i, $task_data);
$task_done_message = new ForkTaskDoneMessage($task_result);
$serialized_message = base64_encode(serialize($task_done_message)) . PHP_EOL;
$bytes_written = @fwrite($write_stream, $serialized_message);
if (strlen($serialized_message) !== $bytes_written) {
error_log('Could not send data to parent process, terminating.');
exit(self::EXIT_FAILURE);
}
fwrite($write_stream, $serialized_message);
}
// Execute each child's shutdown closure before
@ -147,11 +143,7 @@ class Pool
// Serialize this child's produced results and send them to the parent.
$process_done_message = new ForkProcessDoneMessage($results ?: []);
$serialized_message = base64_encode(serialize($process_done_message)) . PHP_EOL;
$bytes_written = @fwrite($write_stream, $serialized_message);
if (strlen($serialized_message) !== $bytes_written) {
error_log('Could not send data to parent process, terminating.');
exit(self::EXIT_FAILURE);
}
fwrite($write_stream, $serialized_message);
fclose($write_stream);