-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add job queue support for mongodb. #623
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
Conversation
…same, no need for extra configuration
Instead of having a |
And, why not have a seperate |
It isn't a driver per se. The 'database' setting uses whatever database driver Laravel is already using. If you set your queue driver to database while the laravel-mongodb driver is in use it will try to use your mongo database and fail. This really just patches it so that it can work as intended. I have not really looked at how the other queues are implemented but since mongodb isn't really a queue then I doubt anybody would want a standalone mongodb queue while using some other database as default laravel db driver. That is my reasoning anyway. :) tl;dr: the queue drivers are for different "queues" and "database" is to use the Laravel database which in this case happens to be mongodb. |
Any progress? |
@jeremy-brenner What did you change in the |
Any news on this? Does it work? |
Currently waiting one @jeremy-brenner's response. |
hmm... ok well, since this post is pretty old, i guess there wont be any response... |
The difference is that Mongo can't "select for update" so it was replaced with a simple loop. As for the naming, the "database" and "table" nomenclature was kept because really the "database" driver has nothing to do with the db and really means "use the ORM" which in this case happens to be Moloquent rather than Eloquent. If I switch then name then I have to do a little bit of redirecting instead of just using the ORM directly like it already does. It's a trivial difference so I left it. It works fine, I use it personally. I have not done a recent merge and test but I use it in a couple projects. |
Sweet! Pretty excited to try it out :) One more question, which i didnt really understand from your post: Do you use Eloquent or Moloquent for this? |
This is a simple connector to make job queues work with Moloquent. It just adds the necessary files and makes no changes to Moloquent directly. You just need to load them as outlined in the docs to make it work. |
Is there any more I can do to help this go more smoothly? Any other outstanding questions that I have not covered? |
I prefer extending original Laravel classes rather than copy pasting all their code. So I need to figure out what was changed before I can create an extended class. Or if you want to refactor your code that's good as well :) |
The issue is pretty straightforward.
Thats really it. I tried extending the Illuminate classes but had little luck. Another approach might be to simply emulate the ->update() behavior in the db driver leaving the database queue driver alone entirely. |
Thanks @jeremy-brenner, I have added your code using an extending class in my latest commits. |
Nice, that was fast :) How about using and setting everything else up? Is it basically the same as: https://laravel.com/docs/5.1/queues Nothing else to keep in mind? Thanks guys! |
@leakingminds I updated the readme as well. |
This adds job queue support by making a few small changes to the Database job queue libraries. It has a separate service provider making it's usage completely optional.