class Google_Task_Runner extends Runner (View source)

Constants

TASK_RETRY_NEVER

TASK_RETRY_ONCE

TASK_RETRY_ALWAYS

Properties

protected array $retryMap from Runner

Methods

__construct($config, $name, $action, array $arguments = [])

No description

from Runner
boolean
canAttempt()

Checks if a retry can be attempted.

from Runner
mixed
run()

Runs the task and (if applicable) automatically retries when errors occur.

from Runner
boolean
attempt()

Runs a task once, if possible. This is useful for bypassing the run() loop.

from Runner
integer
allowedRetries($code, $errors = [])

Gets the number of times the associated task can be retried.

from Runner
setRetryMap($retryMap)

No description

from Runner

Details

__construct($config, $name, $action, array $arguments = [])

Parameters

$config
$name
$action
array $arguments

boolean canAttempt()

Checks if a retry can be attempted.

Return Value

boolean

mixed run()

Runs the task and (if applicable) automatically retries when errors occur.

Return Value

mixed

Exceptions

Exception on failure when no retries are available.

boolean attempt()

Runs a task once, if possible. This is useful for bypassing the run() loop.

NOTE: If this is not the first attempt, this function will sleep in accordance to the backoff configurations before running the task.

Return Value

boolean

integer allowedRetries($code, $errors = [])

Gets the number of times the associated task can be retried.

NOTE: -1 is returned if the task can be retried indefinitely

Parameters

$code
$errors

Return Value

integer

setRetryMap($retryMap)

Parameters

$retryMap