Nukesor / pueue

:stars: Manage your shell commands.
MIT License
4.9k stars 132 forks source link

Enqueue task with guaranteed execution after delay #499

Closed ClementNerma closed 7 months ago

ClementNerma commented 7 months ago

A detailed description of the feature you would like to see added.

Add the ability to enqueue a task to run after a specific delay, and ensure it gets run independently of the parallel tasks limit.

Explain your usecase of the requested feature

Ensure a task will run precisely at the desired time, without having to worry about it being enqueued for an unpredictable amount of time depending on the number of other tasks running at that moment.

Alternatives

No response

Additional context

No response

Nukesor commented 7 months ago

A simple way to achieve this would be to create a group with a high worker limit.

For now, I'll delay building dedicated flag until a few other people wish for such a feature as well, as it's quite easy to do without a dedicated flag.

Nukesor commented 7 months ago

With #500 in place, I think it's reasonable enough to close this issue.

I'm not a big fan of the idea to mix time-scheduled tasks in the same queue as tasks that should be balanced based on the amount of tasks in a queue.

Having these in two different queues is a much cleaner approach and it's a pratice we should incourage instead of mixing things up. I'll close this issue for now, until there's a special usecase that requires such a feature :)