|
| __construct (Google_Client $client, $name, $action, array $arguments=array()) |
| Creates a new task runner with exponential backoff support.
|
|
| attempt () |
| Runs a task once, if possible.
|
|
| canAttmpt () |
| Checks if a retry can be attempted.
|
|
| run () |
| Runs the task and (if applicable) automatically retries when errors occur.
|
|
◆ __construct()
Google_Task_Runner::__construct |
( |
Google_Client | $client, |
|
|
| $name, |
|
|
| $action, |
|
|
array | $arguments = array() ) |
Creates a new task runner with exponential backoff support.
- Parameters
-
Google_Client | $client | The current API client |
string | $name | The name of the current task (used for logging) |
callable | $action | The task to run and possibly retry |
array | $arguments | The task arguments |
- Exceptions
-
◆ attempt()
Google_Task_Runner::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 values
-
◆ canAttmpt()
Google_Task_Runner::canAttmpt |
( |
| ) |
|
Checks if a retry can be attempted.
- Return values
-
◆ run()
Google_Task_Runner::run |
( |
| ) |
|
Runs the task and (if applicable) automatically retries when errors occur.
- Return values
-
- Exceptions
-
The documentation for this class was generated from the following file:
- lib/google/src/Google/Task/Runner.php