GithubHelp home page GithubHelp logo

Comments (3)

lucas34 avatar lucas34 commented on June 2, 2024

In version 5 we changed the architecture to allow custom constraint. Information such as UUID are now owned by the constraint itself. The contraint is also registered only if necessary. Previously all constraint was registered for all the job which makes it inefficient.
https://github.com/lucas34/SwiftQueue/blob/master/Sources/SwiftQueue/Constraint%2BUniqueUUID.swift#L28

Would be possible to build a method to expose the UUID.

from swiftqueue.

pierceglennie avatar pierceglennie commented on June 2, 2024

I see. Thanks for letting me know. I'm a bit confused by the best approach for cancelling an individual job in the new version but for now I've got it working by:

  • Generating a UUID before creating a job
  • Adding this both as a parameter to the job (under the .with and as the ID for the .singleInstance constraint
  • To cancel the job, I then get the UUID from the parameter and cancel with the .cancelOperations(uuid: ...) method

This works although it feels pretty clunky to me since the UUID is basically duplicated and I have to remember to include it as a parameter on job creation, otherwise there is no way to cancel it. I just can't see a better method since the UUID is otherwise not exposed anywhere so far as I can tell.

from swiftqueue.

stale avatar stale commented on June 2, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from swiftqueue.

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.