Comments (5)
because I saw this #504 and it seems that it such option was available but then reverted?
Oh, to be honest I didn't know we have explored it. As far as I can see we decided not to go this way as it obligates maintenance tasks user to always explicitly specify a job which is indeed not the best UX. However I think we can revise the approach if we keep the MaintenanceTasks.job
as the default and only allow specifying with_job_class
if necessary.
Update:
We actually had the global value as the default so perhaps we should just revisit the decision.
from maintenance_tasks.
Does it make sense?
It does! But one thing I would do is to look on the issue at a higher level and consider allowing MaintenanceTasks.job
to be configured on per-task basis. The reason for this is that queue
is a concept from background processing and not from maintenance tasks itself so it would be better for the gem not to know about queues as nothing really enforces the job that executes tasks to even have a queue.
Despite of the gem heavily mentioning Job
concept and providing TaskJob
as basically the only native way to execute a task, I still see it as an "executor" abstraction. By that I mean that technically we still can configure MaintenanceTasks.job =
to be "MyCustomClassThatIsTotallyNotAJob"
and the gem will work as long as MyCustomClassThatIsTotallyNotAJob
string can be constantized, respond to new
, instances of the class respond to enqueue(run)
and the class knows how to handle run
. Using a non-job based executor sounds unnecessary but still possible design-wise as long as the executor is abstracted well enough.
To summarize, to me it makes total sense if we look on it from the per-task executor point of view. If a single task can specify custom executor (a job, for most cases) then this task can be executed within a custom context, whether it's a separate queue, or specific parallel execution constraints, or custom retries policy, the maintenance_task
gem itself won't need to know about these background-execution concepts
from maintenance_tasks.
@nvasilevski hey, thanks. Definitely agree with you, this would be the best solution and personally preferred. I think the only reason I didn't mention it was because I saw this #504 and it seems that it such option was available but then reverted?
from maintenance_tasks.
🤞 I'd definitely be interested, otherwise I may end up with my own job definition and a dynamic queue_as
from maintenance_tasks.
This issue has been marked as stale because it has not been commented on in two months.
Please reply in order to keep the issue open. Otherwise, it will close in 14 days.
Thank you for contributing!
from maintenance_tasks.
Related Issues (20)
- Weekly CI run failed
- Dangerous query method (method whose arguments are used as raw SQL) called with non-attribute argument(s) HOT 1
- Multiple database shards HOT 3
- How do we set `limit`? HOT 8
- No callback is called after Interrupted -> Resumed HOT 5
- Release notes HOT 1
- Web UI and Rails API mode HOT 2
- CSV Task Failure: ActiveRecord::NotNullViolation Error on UUID record_id HOT 2
- please add a CHANGELOG.md file HOT 4
- Weekly CI run failed
- Weekly CI run failed HOT 1
- Weekly CI run failed HOT 1
- Weekly CI run failed HOT 1
- CSV count wrong when new line in cell HOT 8
- Weekly CI run failed HOT 1
- Sorbet typing in templates HOT 1
- Figure out slow system tests
- Ensure `Rack::MethodOverride` HOT 4
- Weekly CI run failed
- Weekly CI run failed HOT 1
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 maintenance_tasks.