Git Product home page Git Product logo

Comments (4)

JakeAustwick avatar JakeAustwick commented on August 31, 2024

I can't find any functions in here to support adding jobs like this, however it does look as though these jobs will be processed, by the scheduler.

from go-workers.

jrallison avatar jrallison commented on August 31, 2024

Hey all, just noticed this ticket, sorry for lack of a response.

There is currently support for polling from scheduled jobs, but it's currently only looking at the retry queue for failed jobs (which get retried with exponential backoff). Therefore, you cannot enqueue scheduled jobs or process scheduled jobs enqueued with perform_at or perform_in with go-workers at the moment.

Anytime you use perform_at or perform_in with Sidekiq, your job is added to a sorted set with the key schedule. So, processing of scheduled jobs with go-workers would be as simple as telling the scheduler to poll the schedule key in addition to the retry key.

Enqueuing schedule jobs would need to modify the enqueue method to take an at option which, if present, would cause the job to be added to the schedule key.

I don't have any time to work on this at the moment, but this is a feature I've been planning on implementing and will need at some point in the future.

Would happily work with someone who wants to send in a pull request.

Cheers,
John

from go-workers.

JakeAustwick avatar JakeAustwick commented on August 31, 2024

I'm new to Go, but I'm pretty competent in a lot of other languages so should be able to handle this.

If I'm not mistaken then what you're saying is that all we need to do to process scheduled jobs is simply include the schedule key here:
https://github.com/jrallison/go-workers/blob/master/workers.go#L19

That would allow us to start processing the scheduled jobs because the scheduler already accepts multiple keys and selects over them (https://github.com/jrallison/go-workers/blob/master/scheduled.go#L35).

from go-workers.

jrallison avatar jrallison commented on August 31, 2024

Yep, that looks correct. The more involved change is the ability to enqueue scheduled jobs, but I think there's value in just processing scheduled jobs enqueued via a sidekiq client in ruby as well.

from go-workers.

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.