Comments (6)
(Probably doesn't need the job_class
, just stuck something in the hash)
from que.
Hmm, there's not, currently. What sort of circumstances are you wanting to do this under? I'm wondering what the API would look like. Maybe something like:
MyJob.run arg1, arg2, :other_arg => arg3
from que.
For example, one job I have is a utility worker that hits an API endpoint that changes very infrequently, and usually the changes don't have to get recorded particularly soon. Letting that job run every few hours is plenty. Occasionally, though, the client will tell notify me that the data has changed and it should get updated ASAP, so it's nice to be able to just run the job once manually.
I know the code could get refactored out of the job class, but honestly sometimes the worker is the most sensible place to let that kind of code live. Rather than having the DRY utility code, and then a dumb job worker calling it and a rake task or some other method on a class that also calls it, just dealing with all that functionality in one place kind of keeps things simpler.
from que.
And I think MyJob.run
make sense; lots of times when I'm doing this I don't really have a need to pass in any arguments, so that's really simple and nice.
from que.
Thank you!!
from que.
from que.
Related Issues (20)
- Need support for draining queues HOT 3
- Support JRuby
- best way to re-activate a job HOT 2
- Que::ActiveRecord::Model.by_args incompatible with ActiveJob JobWrapper HOT 1
- Flaky Errors HOT 2
- Proper way of removing Que from project? HOT 3
- Schema version comment doesn't end up in Rails structure.sql HOT 3
- Que v1 should state that it's incompatible with ruby 3 HOT 2
- Tests fail in Docker on Apple Silicon
- Timeline for v2.0.0. release HOT 1
- Remove unnecessary trigger that notifies about job state transitions HOT 2
- Deprecated method used in connection.rb HOT 1
- Check that all que migrations have been applied at startup HOT 1
- Detect Que schema version missing due to bug in Rails schema dump - affects all versions of Rails 7 prior to 7.0.3
- Migration to v. 2.2.0 failed HOT 2
- Stats about failing jobs HOT 2
- upgrading from v0 to v2 when already on ruby 3 HOT 5
- Migrating from 1.0.0.beta4 to 1.4.1 HOT 5
- Que fails to calculate args and kwargs on Ruby 3.2 with ActiveJob HOT 1
- Migration fails when adding Que to a new project (with rspec) HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from que.