Closed Schweber closed 3 months ago
Could you elaborate your use case? Why exactly do you want to be able to quickly create arbitrary groups?
Could you give me a scenario or an example of how you're using pueue and what exactly you want this feature for?
As to how such a feature would look like:
You're correct, there must be a feature flag, as this behavior is pretty unsafe. Groups exist to allow running multiple queues in parallel. The idea behind groups is to schedule various queues of commands that consume different parts of the system (I/O, Ram, CPU). So just creating new groups whenever a group doesn't exist will lead to problems if users have a typo in their group name while adding a task. Additional tasks would be executed on top of already running tasks, without the user knowing..
So if this would be added, a warning would have to be added on top of the configuration flag.
1
. So you would just a new default queue.My use case is that i want to "look after" my backups in different locations from time to time so i'll have to run certain commands in order for each location (prune, check, list etc.) but doing so in parallel speeds it up tremendously because the limiting factor is ping rather than bandwidth. So i have an alias to create a group for each location with parallel limit 1 and let them run.
As there might be a long time in between this action, i might remove the groups in the meantime (or not). So whether or not my backup command will succeed depends on the state of pueue (e.g. do the groups exist already or not). But i can handle this with a script, no problem.
Anyway, Thank you for making pueue
!
To be honest, this indeed sounds like a pretty specific usecase and a script is probably a neat solution for this problem, especially since it sounds like you're already scripting most of the stuff anyway.
I will close this issue for now as "wont do", but if more people have the need for such a feature, it's always possible to reconsider :)
A detailed description of the feature you would like to see added.
I would like
pueue add -g Group -- Task
not to fail whenGroup
does not exist but instead add the group. This should be behind a flag so as not to change the current default behaviour.Explain your usecase of the requested feature
It would make it easier to use
pueue
as the current state ofpueue
and its groups would not matter anymore and i could always send the commands as if the group did exist already.Alternatives
I could write a script that checks if the group already exists and remove it if this is the case, before running the command for adding the task. The new feature would just be a QoL improvement.
Additional context
No response