Runner
class Runner (View source)
A task runner with exponential backoff support.
Constants
TASK_RETRY_NEVER |
|
TASK_RETRY_ONCE |
|
TASK_RETRY_ALWAYS |
|
Properties
protected array | $retryMap |
Methods
No description
Checks if a retry can be attempted.
Runs the task and (if applicable) automatically retries when errors occur.
Runs a task once, if possible. This is useful for bypassing the run()
loop.
Gets the number of times the associated task can be retried.
No description
Details
at line 102
__construct($config, $name, $action, array $arguments = [])
at line 172
boolean
canAttempt()
Checks if a retry can be attempted.
at line 183
mixed
run()
Runs the task and (if applicable) automatically retries when errors occur.
at line 217
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.
at line 273
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