Comments (6)
That's going to conflict with people who expect a hash of options to their own job, unfortunately. When the argument is first, it's unambiguous.
On May 30, 2014, at 1:15, José Duarte [email protected] wrote:
Hi there,
I believe, to get a more consistent Rails-like syntax, that enqueue should have an options hash opposed to enqueue_in and enqueue_at methods.
So these would be valid method calls:
MyJob.enqueue record, :at => Date.tomorrow.now
MyJob.enqueue record, :in => 1.week
Since the given method definition is valid Ruby:def enqueue(*args, options={})
...
end
it seems to me that it's a most concise approach given Rails method definitions.What do you think?
—
Reply to this email directly or view it on GitHub.
from activejob.
What would work is
MyJob.enque in: 5.hours, args:[1, 2, option: 3]
MyJob.enque at: 5.hours.from_now, args:[1, 2, option: 3]
MyJob.enque args:[1, 2, option: 3]
but I personally prefer the 3 methods enqueue/enqueue_in/enqueue_at
as it's cleaner
from activejob.
from activejob.
What about this?
MyJob.at(Date.tomorrow).enqueue record
MyJob.in(1.week).enqueue record
Or this (bad for default usage)?
MyJob.enqueue(record).now
MyJob.enqueue(record).at Date.tomorrow
MyJob.enqueue(record).in 1.week
from activejob.
I don’t think that’s an improvement on the there separate enqueue methods.
On May 30, 2014, at 5:31 PM, Alexander Senko [email protected] wrote:
What about this?
MyJob.at(Date.tomorrow).enqueue record
MyJob.in(1.week).enqueue record
Or this (bad for default usage)?MyJob.enqueue(record).now
MyJob.enqueue(record).at Date.tomorrow
MyJob.enqueue(record).in 1.week
—
Reply to this email directly or view it on GitHub.
from activejob.
Given the job arguments issue I believe the current syntax is the most appropriate.
from activejob.
Related Issues (20)
- 4.2.0.rc2 NoMethodError Exception: undefined method `deliver_now' for #<Mail::Message:0xfbcfef8> HOT 1
- Can I stack resque gem with plugin resque-history and ActiveJob? HOT 1
- ActiveJob with multiple databases HOT 4
- adapter to Amazon Simple Workflow HOT 1
- Convert resque-statsd to activejob-statsd HOT 9
- Add a proper usage guide HOT 3
- [Feature request] Cancel jobs HOT 40
- Set the job_id attribute on ActiveJob to the value from the adapter HOT 1
- Add deep serialization HOT 1
- amqp, SQS, stomp, other messaging/queuing support? HOT 5
- Support multiple adapters, map adapters to queues HOT 25
- Add new inline-like built-in adapter to process it in a thread HOT 28
- Provide more solid default adapter HOT 40
- Are multiple queues even possible as written? HOT 3
- Girl_friday adapter? HOT 4
- Should we add a delayed mixin so users can delay any method? HOT 32
- delayed job adapter doesn't work properly with float timestamp
- resque job serialization fails under Rails
- Setting resque queue adapter fails HOT 12
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 activejob.