Comments (9)
@Nukesor Hey, I haven't spent as much time as I want to on this. I am still working, but slowly. I will submit a pull request when I am done. Feel free to close the issue. But I will still be working on it.
from pueue.
Ok cool!
Just wanted to check if you're still interested :)
Thanks!
from pueue.
One little idea, hooks.
Along the lines is virtualenvwrapper, allow the configuration and execution of user scripts at various points in the queue lifecycle.
execute scripts on:
- daemon started / stopped
- enqueue/dequeue
- item completed, item completed[success] item completed[failed]
- queue complete
- queue reset / cleared
or go full Factorio and signal an event any time anything does anything.
Then you've got a foundation for user contributed scripts. I'd use a solid notify-send
completion script, but a server installation could use something else (email, SMS, idk). I'm also big on playing loud noises off my local machine, so hooks allow it to become a personal thing.
Configuration could get the hard part if there were to be a different set of hooks for various contexts/projects. For instance, notify me for every item in my video render queue (slow), but don't for my image resize queue (fast).
from pueue.
Cool idea. Never thought about this as I'm using pueue
mainly on my server.
Do you have any experience with this and a nice way to push notifications in python3 for various distributions?
It looks like there are a few different ways to do this, but I've never done something like this before and I would be happy about any advice :).
from pueue.
There is notify-send
available for many distributions. There is simplepush.io for sending notifications to a phone. May be it's possible to make it configurable for the users?? It should be easy to whip up a wrapper that works with both, and other similar services.
For notify send, the command is as simple as
notify-send "Message text here"
For simplepush, the command is:
curl 'https://api.simplepush.io/send/<key>/<subject/<message>'
I can work on this feature and submit PR.
EDIT: I am going through the code now. I am trying to find a way to track a status change. But I don't see a better way than polling the daemon. Is that the best way ? I am open to suggestions.
from pueue.
I think the best way to do this is to launch the notification straight from the daemon.
Maybe in the ProcessHandler: https://github.com/Nukesor/pueue/blob/master/pueue/daemon/process_handler.py#L110
from pueue.
Ah. That makes sense.
from pueue.
@BlitzKraft: Hi!
Are you still planning to work on this feature?
Otherwise I'll probably drop this feature and close the issue.
from pueue.
This sounds like a plausible solution for this problem.
I would probably just look for existing hook scripts in the pueue config dir and pass interesting data as parameter.
Scripts:
- daemon started / stopped (Not sure if this is useful as it's triggered by a user manually)
- enqueue/dequeue (See 1.)
- item completed, item completed[success] item completed[failed] (A single hook with status as parameter, but yes!)
- queue complete (yep!)
- queue reset / cleared (See 1.)
I wouldn't distinguish between different kinds of queues, as this becomes too tricky and might be error prone (wrong categorization of task etc.).
If you put 1000 image resizing tasks in pueue, you'll get 1000 hook calls. I think the proper solution for this problem would be to add a script call to pueue which iterates over those small tasks.
In this case you wouldn't have parallel execution, but you could start the scripts with an offset parameter.
Anyway I really like the idea of hooks! I'll give it a look soon :).
from pueue.
Related Issues (20)
- Improvement of task management HOT 8
- Missing assets HOT 4
- [Feature Request] Add `--state [STATE]` to `pueue wait` HOT 10
- Rerun tasks in group HOT 2
- [BUG] IO error HOT 9
- [BUG] Build fails on FreeBSD because procfs doesn't support FreeBSD HOT 4
- [Feature] Proper FreeBSD build support
- [Debt] Darwin-Libproc is unmaintained HOT 6
- Improve backend performance and scalability HOT 5
- [BUG] Minor: missing newline after status output HOT 5
- Scheduling parameters HOT 2
- [BUG] errors with non-UTF-8 task logs HOT 3
- [Bug] pueued being flagged as Trojan:Win32/Bearfoos.B!ml by Windows Defender HOT 7
- Include sha256 and/or md5 hashes for binary releases HOT 2
- Multi-user Question HOT 5
- send ctrl c to task HOT 1
- error loading completion HOT 2
- [Feature] Add priority to tasks HOT 19
- Enable to remove all groups HOT 6
- [Feature] Add `pueue group --json` flag HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pueue.