In-memory ConfigStorageInterface implementation.

  • experimental The experimental flag means that while we believe this method or class is ready for use, it may change before release in backwards- incompatible ways. Please use with caution, and test thoroughly when upgrading.
public clear()

Clear the JobConfig from storage.

public flush( $idNum)

Run the job with the given id.

  • return bool
public static getInstance()

Singleton getInstance.

public handleFailure( $idNum, array $items)

Save the items to the failureFile. We silently abandon the items upon
failures in this method because there's nothing we can do.

    public load()

    Load a JobConfig from the storage.

    public lock()

    Just return true

    • return bool
    public save(Google\Cloud\Core\Batch\JobConfig $config)

    Save the given JobConfig.

    • return bool
    public shutdown()

    Run the job for remainder items.

    public submit( $item, $idNum)

    Hold the items in memory and run the job in the same process when it
    meets the condition.

    We want to delay registering the shutdown function. The error
    reporter also registers a shutdown function and the order matters.
    {@see \Google\ErrorReporting\Bootstrap::init()}

    • return void
    public unlock()

    Just return true

    • return bool
    private $baseDir
    • var string Base directory for the failure files.
    private $config
    private $created
    private $failureFile
    • var string A filename to save the failed items.
    private $hasShutdownHookRegistered
    private $items
    private $lastInvoked
    private __clone()

    To prevent cloning.

    private __construct()

    The constructor registers the shutdown function for running the job for
    remainder items when the script exits.

    private __sleep()

    To prevent serialize.

    private __wakeup()

    To prevent unserialize.

    private getFailedFiles()

    Get all the filenames for the failure files.

    • return array Filenames for all the failure files.
    private initFailureFile()

    Determine the failureFile.

    public static getInstance()

    Singleton getInstance.

    © 2020 Bruce Wells
    Search Namespaces \ Classes
    ConfigurationNumbers (0-9.) only