Comments (4)
This can be tricky to implement. Useful, certainly, but tricky. What kind of dependency do you want, here? By job ID? By job class? Something else? If you're using the by-ID approach, it's not terribly hard to determine when the job is done, but if you want to support by-class, things get more complex. Would you want support for a job depending on multiple prior jobs, waiting for all of them to complete before running? That adds a bit more complexity as well.
You'd want to add dependent jobs to a separate Redis key (probably a set) until the job they depend on completes, using a hook or the job's teardown to move them onto the regular job queue when the dependency is met. The alternative is to have the job itself determine if its dependency is met, then requeue itself if not. This is a really inefficient approach, which makes it a bad option.
It can be done, but it'll take some thinking to do it right.
from bccresquebundle.
I was thinking by job id much like the JobQueueBundle. We should probably decide on tactics before someone starts coding it though.
from bccresquebundle.
Working on this and more management features with a db persistence here: https://github.com/DABSquared/BCCResqueBundle
from bccresquebundle.
By-ID makes sense. I'd like to see multi-ID dependency support (job B needs job A to complete before it can start, but job D needs jobs B and C to both complete first), if possible.
Of course, I'd also like to see this upstream, in PHP-Resque proper. But getting code merged there is unlikely for now.
from bccresquebundle.
Related Issues (20)
- New Relic transaction naming support for Jobs? HOT 1
- Event for failed jobs? HOT 3
- Cleanly shutdown Supervisor? HOT 2
- Warn users of potential data loss
- call on getContainer() on class that extends ContainerAwareJob gives an error HOT 1
- Removing non responsive workers HOT 3
- new stable release HOT 12
- Cannot install from composer HOT 1
- autoload.php with supervisord HOT 2
- bcc:resque:worker-run commands
- supervisor - waiting for queue HOT 3
- How to get resque log in Monolog? HOT 3
- Scheduled worker - strlen expects parameter 1 to be string HOT 2
- Event kernel.terminate is not called hence SwiftMailer spool does not work HOT 2
- Allow to set *Kernel in bundle configuration
- Workers won't run (Windows) HOT 2
- Support for Symfony 3 HOT 5
- How can I set a Job priority HOT 7
- Supervisor processes are throwing exceptions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bccresquebundle.