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

Use a time window to detect changes in batches #124

Closed
choldgraf opened this issue Feb 12, 2023 · 9 comments
Closed

Use a time window to detect changes in batches #124

choldgraf opened this issue Feb 12, 2023 · 9 comments

Comments

@choldgraf
Copy link

Currently a re-build is triggered the moment that a file in a watched folder is updated. However, sometimes you want to make a few updates in quick succession. Currently, this will cause the re-build to trigger immediately after the first re-build completes. It would be nice if a user could configure a window where changes would be batched together in a single reload event.

Looking at the livereload-python docs, something like this seems to be possible with a delay parameter.

This package is just directly using the Server class so maybe we could make that configurable:

https://github.com/executablebooks/sphinx-autobuild/blob/ea4d04f4f68f564e65ac21843d4839ce24a6e0ae/src/sphinx_autobuild/cli.py#L175

@welcome
Copy link

welcome bot commented Feb 12, 2023

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@pradyunsg
Copy link
Collaborator

Duplicate off #87

@asmeurer
Copy link

I don't want there to be a delay in the rebuild. That would be a degradation in the user experience as far as I'm concerned.

The problem I described in #123 is that it rebuilds off of files that were changes since before the previous rebuild, basically rebuilding one file at a time.

@pradyunsg
Copy link
Collaborator

pradyunsg commented Feb 14, 2023

As I see it, #87 is meant to solve exactly that issue -- to throttle builds so that when there's more than one change in a time period, they're all bundled together and a single rebuild is performed.

@asmeurer
Copy link

asmeurer commented Feb 14, 2023

Maybe I'm misunderstanding what is being proposed. In the common case where I am just editing a single file I would still want the build to be instant so that I can see the built version as quickly as possible.

@pradyunsg
Copy link
Collaborator

https://github.com/executablebooks/sphinx-autobuild/blob/ea4d04f4f68f564e65ac21843d4839ce24a6e0ae/src/sphinx_autobuild/cli.py#L40

The build directory not being ignored is likely a bug. #87 covers the infinite loop aspects of the complaint and #125 covers the blocking serving of the pages.

@pradyunsg
Copy link
Collaborator

(I have limited bandwidth to write a lot here, apologies for the terseness)

FWIW, I'm not sure what you are trying to say either @asmeurer -- are you saying that #87 doesn't cover your concerns, or that this issue does not cover your concerns, or something else?

@choldgraf
Copy link
Author

choldgraf commented Feb 14, 2023

I believe that @asmeurer is responding to my note that there is "a delay parameter" in livereload, and suggesting that this would not be the right fix. That makes sense to me - I was just noting it as something that seemed relevant. I have no idea how livereload works so am just grasping at straws of things that might be useful :-)

@guideloom
Copy link

Make the delay option optional.. if set to 0, it works as it is today. If set to anything else, it's the number of seconds to wait before a rebuild happens.. problem solved for all.

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

4 participants