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

Enable a means of curtailing read_docx? #653

Open
Mrodent opened this issue Sep 19, 2023 · 0 comments
Open

Enable a means of curtailing read_docx? #653

Mrodent opened this issue Sep 19, 2023 · 0 comments

Comments

@Mrodent
Copy link

Mrodent commented Sep 19, 2023

Is your feature request related to a problem? Please describe.

Inability to end parsing mid-stream
In a Rust context, if I am parsing multiple large .docx documents in parallel threads, it can take a significant time for read_dox() to end, and there could be a fairly simple way of tweaking your code to detect an AtomicBool

Describe the solution you'd like

Provide an AtomicBool called "stop_parse" or something. The user could then set that to true in an independent thread. The code used by read_dox() would be liberally sprinkled with a test to detect that "stop_parse" was now at true, and would exit the parsing ASAP. Graceful shutdown in other words.

Describe alternatives you've considered

It is possible to run in another process and kill the process. Or just wait for the long thread task(s) to end, accepting that a number of threads will be needlessly occupied for a second or more after the stop instruction is given.

Additional context

This is powerful code which on a big file leads to substantial processing. It would be nice to provide a means of shutting down gracefully.
🥰

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

No branches or pull requests

1 participant