Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UX idea: make pueue parallel return current level of parallelism if not extra argument was given #264

Closed
d33tah opened this issue Nov 17, 2021 · 3 comments
Labels
s: Client This issue touches the pueue client s: Daemon This issue touches pueue daemon t: Feature A new feature that needs implementation

Comments

@d33tah
Copy link

d33tah commented Nov 17, 2021

Hi! First of all, thanks for creating pueue! It's a real gem - I rarely find a tool that I pick up so quickly and immediately come up with many use cases for!

I sometimes use pueue as a tunable replacement for xargs -P. I start with a small number of parallel processes and once I get a better feel of how much resources I need, I ramp it up. Now, the question is: how much should I raise the limit by? I can't just say pueue parallel -g xargs +10 to increase it by 10 (or at least it doesn't seem to be documented), so I first need to find out what's the current level. Now, if the queue is deep, this information is "hidden" at the top of pueue status -g xargs. Beacuse of that, there's a major risk of the user missing the proverbial needle in the haystack.

My proposed solution is to change the behavior of pueue parallel -g xargs. Currently it prints an error saying it's missing a parameter:

 > pueue parallel -g xargs
error: The following required arguments were not provided:
    <PARALLEL_TASKS>

USAGE:
    pueue parallel --group <group> <PARALLEL_TASKS>

My suggestion is for it to return something like "Current parallelism for group xargs is: 20. In order to change it, run pueue parallel --group <group> <PARALLEL_TASKS>. This behavior of "get if no parameters, set if there's one" is common in other CLI tools, though nothing other than Git immediately comes to my mind.

Describe alternatives you've considered

  1. pueue parallel --get-paralellism -g xargs
  2. pueue parallel -g xargs +10

Actually solution no. 2 and what I proposed above aren't mutually exclusive, so it might be a good idea to implement both.

Additional context

Feature wasn't there as of 1.0.3, which I installed via cargo sometime last week.

@d33tah d33tah added the t: Feature A new feature that needs implementation label Nov 17, 2021
@Nukesor
Copy link
Owner

Nukesor commented Nov 18, 2021

The current amount of parallel tasks can already be seen with pueue group

We might think about moving the parallel subcommand to the group subcommand in the long run. This is probably the cleaner solution to this problem.

There was already a proposal to add subcommands to group.

  • pueue group add $name
  • pueue group remove $name
  • pueue group parallel $name $amount

I guess this is something for a v2.0 release.

@Nukesor Nukesor added s: Daemon This issue touches pueue daemon s: Client This issue touches the pueue client labels Dec 30, 2021
@Nukesor
Copy link
Owner

Nukesor commented Jan 12, 2022

After reading through your proposal once again, does pueue group satisfy your need for an easy way of inspecting the amount of parallel tasks per group?

Moving the parallel command to the group subcommand seems somewhat unwieldy, pueue group parallel $name $amount really isn't nice to type.

@Nukesor
Copy link
Owner

Nukesor commented Jan 16, 2022

Implemented in 69fdf80

@Nukesor Nukesor closed this as completed Jan 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: Client This issue touches the pueue client s: Daemon This issue touches pueue daemon t: Feature A new feature that needs implementation
Projects
None yet
Development

No branches or pull requests

2 participants