FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Implemented retry-exectution for specific handler by wachterjohannes · Pull Request #39 · php-task/php-task · GitHub

Implemented retry-exectution for specific handler - #39

Merged
chirimoya merged 2 commits into
masterfrom
feature/retry-execution
Aug 22, 2017
Merged

Implemented retry-exectution for specific handler#39
chirimoya merged 2 commits into
masterfrom
feature/retry-execution

Conversation

wachterjohannes commented Aug 17, 2017
edited
Loading

Copy link
Copy Markdown
Member

Related PR php-task/TaskBundle#41 php-task/docs#7 sulu/SuluArticleBundle#238

This PR enhances the TaskRunner to retry executions for specific Handler.

Example

class TestHandler implements TaskHandlerInterface, RetryTaskHandlerInterface
{

    public function getMaximumAttempts()
    {
        return 3;
    }

    public function handle($workload)
    {
        try {
            $this->doSomething();
        } catch (SpecificException $exception) {
            throw new FailedException($exception);
        }
        
        // other exceptions will be propagated to the runner
        // the runner will retry the execution until the max-attempts are reached
    }
}

TODO

Comment thread src/Task/Runner/TaskRunner.php Outdated
try {
return $this->executor->execute($execution);
} catch (RetryException $exception) {
// this find is necessary if the storage because the storage could be

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

this find is necessary because the storage could be ...

Comment thread src/Task/Runner/TaskRunner.php Outdated
{
$execution->setEndTime(new \DateTime());
$execution->setDuration(microtime(true) - $start);
// this find is necessary if the storage because the storage could be

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

this find is necessary because the storage could be ...

chirimoya merged commit 78c8359 into master Aug 22, 2017
chirimoya deleted the feature/retry-execution branch August 22, 2017 12:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL