Core/src/Batch/SysvConfigStorage.php
public function save(JobConfig $config)
    {
        $shmid = shm_attach($this->sysvKey, $this->shmSize, $this->perm);
        if ($shmid === false) {
            throw new \RuntimeException(
                'Failed to attach to the shared memory'
            );
        }

        // If the variable write fails, clear the memory and re-raise the exception
        try {
            $result = shm_put_var($shmid, self::VAR_KEY, $config);
        } catch (\Exception $e) {
            $this->clear();
            throw new \RuntimeException($e->getMessage());
        } finally {
            shm_detach($shmid);
        }
        return $result;
    }
public function save(JobConfig $config)
    {
        $shmid = shm_attach($this->sysvKey, $this->shmSize, $this->perm);
        if ($shmid === false) {
            throw new \RuntimeException(
                'Failed to attach to the shared memory'
            );
        }

        // If the variable write fails, clear the memory and re-raise the exception
        try {
            $result = shm_put_var($shmid, self::VAR_KEY, $config);
        } catch (\Exception $e) {
            $this->clear();
            throw new \RuntimeException($e->getMessage());
        } finally {
            shm_detach($shmid);
        }
        return $result;
    }
public function save ( JobConfig $ config ) { $ shmid = shm_attach ( $ this -> sysvKey , $ this -> shmSize , $ this -> perm ) ; if ( $ shmid === false ) { throw new \ RuntimeException ( 'Failed to attach to the shared memory' ) ; } // If the variable write fails, clear the memory and re-raise the exception try { $ result = shm_put_var ( $ shmid , self :: VAR_KEY , $ config ) ; } catch ( \ Exception $ e ) { $ this -> clear ( ) ; throw new \ RuntimeException ( $ e -> getMessage ( ) ) ; } finally { shm_detach ( $ shmid ) ; } return $ result ; }
Save the given JobConfig.

@param JobConfig $config A JobConfig to save.
@return bool
@throws \RuntimeException when failed to attach to the shared memory or serialization fails
Save the given JobConfig .