-
Notifications
You must be signed in to change notification settings - Fork 0
[FEAT] Batch Task State and Task Progress #1
Conversation
This is supposed to get the current state of the app and any tasks that are currently running. The point is to enable parallel tasks and advanced batch tasks with progress indicators.
Part of my goal is to run multiple image operations in parallel when running in batch mode and prevent individual failures from causing a full on crash.
|
There would also be a display showing the current and successful image operations (which can be tuned with a verbosity flag) Example:
|
Conversion is done using the `save_image_format` function, so a separate module is not necessary
The `transparentize` argument struct does not need to save the image, much like the other arguments, this lets me do batch operations on each image. These changes have been done to prepare for batch operations and operation tracking.
This function runs operations on single images, only saving them immediately after the operation is complete or quitting with an error when a failure occurs
This function should check individual images and do various operations on them. As of now the functionality is very incomplete.
I decided to do individual checks instead as it would be easier to track individual failed images than to group them all at once
Will replace with a better check
This is a bit of an incomplete implementation but the idea is to store the decoded result of an image in it's respective task element in the queue. Once it has been stored we can check if it has failed or not and check later on. Then we obtain the paths of the decoded images
At the moment our error handling schemes are not very good and I hope to improve that, I will attempt to use AnyHow and see how I can integrate it's functionality into error handling. Sadly this commit contains many borrow errors and needs to be re-evaluated.
I have been making good progress on this goal, so far we have a relatively efficient task queue which tracks every task in batch operations. |
However, decoding images seems to take up a good chuck of memory, usage jumps as high as 400Mb but shortly after it drops back down to around 60 and fluctuates when processing images. |
Every task that is either failed or completed leaves the `decoded_tasks()` resultant vector, so we have no need to use the index obtaining ids
I have decided to split the displaying parts of this PR into another one, this pull is getting really long and I would rather merge everything as is now and then add the feature in another pull. |
Introduction
This pull request is a part of my attempt to rethink how this program works.
I had originally planned to have everything run synchronously. However, once I started working on
batch tasks I realized that I need a new way of going about image operations.
Goals
Time frame
I hope to get this done and released for the next version bump, being
v0.2.0
.I have no clue how long it will take, I still have a lot to learn about implementing these features.