Giter Site home page Giter Site logo

Comments (6)

ssoroka avatar ssoroka commented on August 24, 2024

is it possible that the qless-core API is already a little crowded? REDIS itself implements many specific (short) methods to do specific things. qless-core seems to have a few methods that do many things, depending on the parameters you send them.

from qless.

myronmarston avatar myronmarston commented on August 24, 2024

Doesn't Qless already support replacing an existing job if you put a new one with the same jid? I've been using that for a while.

Not sure what you mean by "not replacing" a job with the same jid--if you're putting a job with the jid of an existing job, what else would it do?

from qless.

ssoroka avatar ssoroka commented on August 24, 2024

There's two approaches you could take when placing a job and there's already one in queue:

  1. Delete the job you're placing (not place it) and leave the existing one
  2. Delete the existing job and place the new one.

Both are useful depending on the application.

Eg: cache regeneration would use #1, but list sort order changing would use #2

  • Steven Soroka

On 2012-10-08, at 10:42 PM, Myron Marston [email protected] wrote:

Doesn't Qless already support replacing an existing job if you put a new one with the same jid? I've been using that for a while.

Not sure what you mean by "not replacing" a job with the same jid--if you're putting a job with the jid of an existing job, what else would it do?


Reply to this email directly or view it on GitHub.

from qless.

myronmarston avatar myronmarston commented on August 24, 2024

Delete the job you're placing (not place it) and leave the existing one

Honestly, I have a hard time seeing how this would ever be desired behavior. It sounds too much like "silent failure". If Qless isn't going to do what you ask (e.g. put the job), then it would seem preferable to raise an error, and the you're code could always rescue it and ignore it.

Can you explain a bit more about your cache regeneration use case? My use case of Qless may just be entirely different.

Also, I feel like #put should have the same semantics as an HTTP PUT (e.g. idempotent create or replace).

from qless.

ssoroka avatar ssoroka commented on August 24, 2024

#1 is common: any throttling code typically does exactly this. The first request goes through and the rest don't until the first is processed. If you're doing some slow task in the background, it's not out of date until the first one you asked for completes, and other requests are redundant and superfluous. Because this has to happen atomicly, a simple check first to see if the record is in the queue isn't good enough.

from qless.

phs avatar phs commented on August 24, 2024

Idempotent enqueuing (1.) is something I'm also interested in. I have an upstream slow, durable dumb queue that I'd like to feed into my qless (actually plines) installation. We're still feeling out if we want a push or a pull connecting them, but a batch push would certainly want idempotency to avoid clobbering jobs in flight.

from qless.

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.