Coder Social home page Coder Social logo

Dependent Jobs about bccresquebundle HOT 4 OPEN

bassrock avatar bassrock commented on June 21, 2024
Dependent Jobs

from bccresquebundle.

Comments (4)

danhunsaker avatar danhunsaker commented on June 21, 2024

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.

bassrock avatar bassrock commented on June 21, 2024

I was thinking by job id much like the JobQueueBundle. We should probably decide on tactics before someone starts coding it though.

from bccresquebundle.

bassrock avatar bassrock commented on June 21, 2024

Working on this and more management features with a db persistence here: https://github.com/DABSquared/BCCResqueBundle

from bccresquebundle.

danhunsaker avatar danhunsaker commented on June 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.