Giter VIP home page Giter VIP logo

Comments (2)

quirkey avatar quirkey commented on July 26, 2024

Interesting, This could also be useful if you wanted to 'retry' a job. I guess the question would be, how would the API for spawning jobs from within jobs have to change? Or how would you spawn a job while tracking the parent? You would probably have to explicitly pass the parents UUID. FYI - Resque::Status is just a Hash (with helpers), so besides the fancy children method, you could implement this pretty easily:

def perform
# spawn another job tracking the parent
self.class.create(:parent_uuid => uuid)
end

from resque-status.

zapnap avatar zapnap commented on July 26, 2024

Yeah there's also the possibility that the parent finishes while children are still executing (unlike a process), and is no longer an active Job. That's a valid use case too.

I'm not certain how the API would change. In "classic" Resque we've just been doing another Resque.enqueue with the target job, passing a common group identifier into the options hash. Then using an admittedly ugly monkeypatch to increment / decrement a counter whenever it finds a group id. The counter values are then queryable so a user can determine the number of jobs left in queue for a particular group id.

Now that you've released resque-status this seems like a much nicer place for that kind of logic to live. Just need to figure out how to work it into the API in a reusable way I guess.

from resque-status.

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.