Skip to content
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

Merged
merged 8 commits into from
Feb 4, 2016

Conversation

petrabarus
Copy link
Contributor

No description provided.

@petrabarus petrabarus force-pushed the add-db-redis-queue branch 2 times, most recently from abc784c to eb2f544 Compare January 16, 2016 22:34
@petrabarus petrabarus force-pushed the add-db-redis-queue branch 3 times, most recently from 747f731 to cdebd00 Compare January 17, 2016 03:32
@@ -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(
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link

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;

petrabarus added a commit that referenced this pull request Feb 4, 2016
[WIP] Refactor queue and add DB and Redis implementation.
@petrabarus petrabarus merged commit 64365b1 into master Feb 4, 2016
@petrabarus petrabarus deleted the add-db-redis-queue branch February 4, 2016 04:03
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.

None yet

3 participants