src/Psalm/Internal/Fork/Pool.php
private static function streamForParent(array $sockets)
    {
        list($for_read, $for_write) = $sockets;

        // The parent will not use the write channel, so it
        // must be closed to prevent deadlock.
        fclose($for_write);

        // stream_select will be used to read multiple streams, so these
        // must be set to non-blocking mode.
        if (!stream_set_blocking($for_read, false)) {
            error_log('unable to set read stream to non-blocking');
            exit(self::EXIT_FAILURE);
        }

        return $for_read;
    }
private static function streamForParent(array $sockets)
    {
        list($for_read, $for_write) = $sockets;

        // The parent will not use the write channel, so it
        // must be closed to prevent deadlock.
        fclose($for_write);

        // stream_select will be used to read multiple streams, so these
        // must be set to non-blocking mode.
        if (!stream_set_blocking($for_read, false)) {
            error_log('unable to set read stream to non-blocking');
            exit(self::EXIT_FAILURE);
        }

        return $for_read;
    }
private static function streamForParent ( array $ sockets ) { list ( $ for_read , $ for_write ) = $ sockets ; // The parent will not use the write channel, so it // must be closed to prevent deadlock. fclose ( $ for_write ) ; // stream_select will be used to read multiple streams, so these // must be set to non-blocking mode. if ( ! stream_set_blocking ( $ for_read , false ) ) { error_log ( 'unable to set read stream to non-blocking' ) ; exit ( self :: EXIT_FAILURE ) ; } return $ for_read ; }
Prepare the socket pair to be used in a parent process and
return the stream the parent will use to read results.

@param resource[] $sockets the socket pair for IPC

@return resource
Prepare the socket pair to be used in a parent process and return the stream the parent will use to read results .