cloudtasker
cloudtasker copied to clipboard
Ability to tag or add context to jobs
I sometimes feel that job arguments are not enough or become too expansive when a certain context needs to be passed down to sub jobs (especially in the context of batch jobs)
I feel like it could be nice to have tags or a shared context that can be inherited by jobs so we can know the source/lineage of the job and take actions based on that.
E.g:
- you have generic jobs used to retrieve data from GitHub. These jobs are used for long polling and on user request to refresh data
- GitHub has API credits, so you're limited in the number of calls per hour. You don't want long polling jobs to eat up all your credits because it means that users won't be able to ask for a refresh until credits reset
- When you enqueue these jobs you tag them with "on-request" or "long-polling"
- Based on this tag and the amount of remaining credits you can decide in the job whether to run/reenqueue/abort the job
Tracing the lineage/context of jobs can of course be done with arguments but I find it clunky. Queues can also be used for that purpose but they're heavy to create/use - tags should be lightweight to use.
I'm still evaluating whether this a good idea or an overkill.