-
Notifications
You must be signed in to change notification settings - Fork 229
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
Frequently written files may get debounced indefinitely #146
Comments
I'd accept a PR implementing this for the current branch. |
I would love to have this feature. Notify is used by Xi Editor and Im working on Tail Toggle issue. In my use case, tailing happen so fast, I get NoticeWrite event at the beginning and one Write event at the very end. Im using a very simple script (unending for loop with counter) that appends to a file im tailing. Solution by @ThomWright will be a good start.
|
What do you think, @passcod? |
Yes, that sounds like a good tool to have.
Another complementary technique would be to create a raw watcher concurrent
to the debounced one, give it the tailed file to watch, and pass it a
*clone* of the Sender, so events go to the same place... that currently
cannot work because of the different types, but I'm wondering if it would
not be useful to make it possible
…On Tue, 19 Feb 2019, 09:14 Daniel Faust ***@***.*** wrote:
@sjoshid <https://github.com/sjoshid>:
- The deboucer is built on top of the raw watcher, it's meant to be a
higher level interface. The idea is to have a high level interface that's
useful to most users and a low level interface for those with more specific
needs.
- Maybe we could add an additional message like OngoingWrite that is
emitted periodically for a file until the write is finished. Maybe we
should even add a separate delay for that.
What do you think, @passcod <https://github.com/passcod>?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#146 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAJgixkH5-1LKWzVmsBJ1-UNJV0CYBFPks5vOwmJgaJpZM4RVtL9>
.
|
Thank you, guys. It is clear to me know. I like the idea of adding |
I haven't looked at this at all, or even thought about it since raising this issue. Feel free to explore some solutions! |
@passcod
|
Oh, both of us is good. I was just busy yesterday. The |
@passcod Correct me if Im wrong but here's my understanding so far:
Approach There are other details I haven't hashed out yet (like, when should |
It's quite subtle, there are a couple The pub type OperationsBuffer = Arc<Mutex<HashMap<PathBuf, (Option<op::Op>, Option<PathBuf>, Option<u64>)>>>; path => (op, from_path, timer_id)
Most significant event means for example that a newly created file that is written to within the debounce time frame will still only hold the When a rename event is detected, the original path is stored in The |
Thanks for explanation, @dfaust.
This logic is done in Btw what do you think of the approach? Do you have something else in mind? |
If the
Yes.
I would have to think about that myself for a while and I don't have much time at the moment. But here is an idea: Another question is, should |
Only Lord knows how I missed that. And thank you. Will think about approach in more details. |
@dfaust @passcod |
@passcod |
Mid-april |
If I have a file which consistently gets written to more frequently than the debounce timeout, then the debounced watcher seems to never emit a
Write
event.What do you think about the idea of a max timeout option, where a
Write
will always be emitted after a maximum time following aNoticeWrite
?Or is this something I should implement myself as a client of the library? In which case, maybe it's worth noting it in the docs?
I'm happy either way, it was just something which caught me out 😀
The text was updated successfully, but these errors were encountered: