Coder Social home page Coder Social logo

Comments (3)

bkeepers avatar bkeepers commented on June 18, 2024

That would be nice. We've done the same thing manually with #enqueue

Delayed::Job.enqueue(Delayed::PerformableMethod.new(model, :expire, []), 0, ExpireTime.from_now)

Let me think about this a little more. I'd like to come up with a way to fold this into #send_later.

from delayed_job.

cdb avatar cdb commented on June 18, 2024

FWIW I've tried this:

def send_at(time, method, *args)
  Delayed::Job.enqueue( Delayed::PerformableMethod.new(self, method.to_sym, args), 0, time)
end

I took the concept from here: http://github.com/jstorimer/delayed_job/commit/826422f440f360e0d811665ffd423c7dad92b304 but moved it into a send_at method instead, slightly different syntax than you're suggesting. Having just done this I don't have production experience with it, but it's working just fine locally

from delayed_job.

bkeepers avatar bkeepers commented on June 18, 2024

Added #send_at(time, method, *args) for queueing jobs in the future. Closed by 930fbca

from delayed_job.

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.