-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Refactor queue and add DB and Redis implementation. #27
Conversation
abc784c
to
eb2f544
Compare
eb2f544
to
eb67933
Compare
747f731
to
cdebd00
Compare
cdebd00
to
c7a4a9f
Compare
@@ -94,29 +205,96 @@ public function run(Job $job) { | |||
$id = $job->route; | |||
} | |||
\Yii::error("Fatal Error: Error running route '{$id}'. Message: {$e->getMessage()}", 'yii2queue'); | |||
throw new \yii\base\Exception("Error running route '{$id}'. Message: {$e->getMessage()}. File: {$e->getFile()}[{$e->getLine()}]. Stack Trace: {$e->getTraceAsString()}", 500); | |||
throw new \yii\base\Exception( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally the error/exception handler is an attribute / compose-able, so people can change the handler with what they want. Maybe they don't want to have \Yii::error
, or maybe they want specific job to have warning instead of error, or maybe they want different output format so it can easily parsed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, since there is a new method to release
a job to handle queue like DB and Redis, unlike SQS, that have to manually make the job visible, we should have an error handler for this. So there is three types of job execution: 1) success (true
), 2) fail (false
) and 3) error (Exception
).
Add test for run method Add purge method Add size method.
@@ -18,7 +17,8 @@ | |||
* @author Petra Barus <petra.barus@gmail.com> | |||
* @since 2015.02.24 | |||
*/ | |||
class SqsQueue extends Queue { | |||
class SqsQueue extends Queue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the namespace to namespace UrbanIndo\Yii2\Queue\Queues;
Queue class is located on this path Urbanindo\Yii2\Queue\Queue;
so, please add use Urbanindo\Yii2\Queue\Queue;
[WIP] Refactor queue and add DB and Redis implementation.
No description provided.