Code Monkey home page Code Monkey logo

Comments (11)

ChocolateOverflow avatar ChocolateOverflow commented on June 11, 2024 1

Sounds like pause --wait and start are exactly what I wanted - defer all added tasks and manually resume queueing later.

from pueue.

Nukesor avatar Nukesor commented on June 11, 2024

I'm curious, could you give a short explanation of your use-cases?
I.e. what are you using Pueue for and how are you using it (mostly manual, scripting, etc.)

I usually like to get a good understanding of a use-case before implementing a new feature.

from pueue.

ChocolateOverflow avatar ChocolateOverflow commented on June 11, 2024

In my case, I'm using pueue to download files, some large, some small. I have a yt group for youtube-dl downloads with some parallel setting.

Most of the time, I just enqueue as I browse, but I want to stash the downloads if I'm gonna turn my PC off soon, then start/enqueue the whole group when I'm back.

Basically, this is mostly for tasks that are most likely gonna take a long time but shouldn't or can't be continued after stopping.

from pueue.

Nukesor avatar Nukesor commented on June 11, 2024

This should actually not be necessary.

The pueue daemon automatically pauses groups that have "Queued" entries in it, when it starts up.

-> Just skip the step of stashing the tasks and start the group via pueue start

Alternatively, you can also explicitly pause the group via pueue pause -g your_group. You can also add the --wait option, if you want the current download to finish before rebooting.

from pueue.

ChocolateOverflow avatar ChocolateOverflow commented on June 11, 2024

The issue here is that start will force-start the tasks, but I just want to enqueue those tasks.

Stashing & pausing aren't the main issue here, it's wanting to resume queueing stashed tasks.

from pueue.

Nukesor avatar Nukesor commented on June 11, 2024

pueue start --group your_group doesn't force-start all tasks of a group, it just resumes the group. I.e. tasks in a paused group won't be started, even if they're Queued.

They'll only be started as soon as the group is marked as running.

image

from pueue.

ChocolateOverflow avatar ChocolateOverflow commented on June 11, 2024

In my case, the group isn't pause. I just add & stash tasks with add -s -g mygroup ... and enqueue them later.

from pueue.

Nukesor avatar Nukesor commented on June 11, 2024

You could just do a pueue pause and skip the -s flag on add lateron.

Wouldn't this work for you? If so, whats your exact usecase?

from pueue.

Nukesor avatar Nukesor commented on June 11, 2024

To give you an example:

pueue pause --group your_group
pueue add --group your_group 'some_command'
pueue add --group your_group 'some_other_command'
pueue add --group your_group 'some_other_command_2'

# Reboot the pc and restart pueued
pueue status
# This should show that `your_group` is paused
pueue start --group your_group
# Pueue should now process the group as usual

from pueue.

ChocolateOverflow avatar ChocolateOverflow commented on June 11, 2024

Oh I guess I misunderstood pause and start.

    pause            Either pause running tasks or specific groups of tasks.
                         By default, pauses the default group and all its tasks.
                         A paused queue (group) won't start any new tasks.

My understanding of pause was: this will also pause running tasks like with ctrl+Z and start would later use something like fg to resume them.

    start            Resume operation of specific tasks or groups of tasks.
                         By default, this resumes the default group and all its tasks.
                         Can also be used force-start specific tasks.

My understanding of start was: this will put all the tasks in the group in the running state, even if the number of tasks is larger than the parallel setting.

Reading the wiki:

For instance, pueue pause -g cpu will pause all tasks in the cpu group.

"Pause all tasks" sounded like "ctrl-Z all tasks" to me.

If pause stashes all tasks added after it's called, and start later enqueues all those tasks, that sounds exactly like what I wanted.

from pueue.

Nukesor avatar Nukesor commented on June 11, 2024

For instance, pueue pause -g cpu will pause all tasks in the cpu group.
"Pause all tasks" sounded like "ctrl-Z all tasks" to me.

This is true, pueue pause will indeed send a SIGSTOP to all running tasks, except you when you add the --wait flag, as described in an earlier message :)

Alternatively, you can also explicitly pause the group via pueue pause -g your_group. You can also add the --wait option, if you want the current download to finish before rebooting.

pueue start will then continue all "Paused" tasks as well as normal operation for that group.

The pueue pause call doesn't stash any tasks. It will just pause the Group, preventing any tasks from being automatically started.

from pueue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.