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

Enhancement: signal to end processing early e.g. via AbortController API #4326

Open
dmitrizzle opened this issue Feb 13, 2025 · 2 comments
Open

Comments

@dmitrizzle
Copy link

I couldn't find anything in the docs or in the repo except for the timeout option. However, I'd like to kill the process while it's still happening (for example, if the user requests the process to be stopped, I would like to free up the memory).

I've noticed that there's _vips_shutdown() being used internally and I wonder if this function does the above?

@lovell
Copy link
Owner

lovell commented Feb 28, 2025

Given the multi-threaded nature of image processing we can't stop things immediately but it might be possible to set a flag that says "stop when all running threads have joined" and periodically check that. I'm unsure how we'd get this info across the JavaScript/C++ divide most efficiently so this would require some experimentation.

In terms of API, something like an AbortController would make sense.

This partly relates to #2189 - it might be possible to implement both via the same means.

@lovell lovell changed the title Is there a way to kill the process? Enhancement: signal to end processing early e.g. via AbortController API Feb 28, 2025
@dmitrizzle
Copy link
Author

Ah, thank you. I am currently planning to kill the entire container when the job is complete to be safe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants