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

implement passive debouncer without blocking #467

Merged
merged 1 commit into from
Jul 15, 2023
Merged

Conversation

0xpr03
Copy link
Member

@0xpr03 0xpr03 commented Jan 28, 2023

Remove active polling and introduce a passive waiting method that can also shutdown everything.

This fixes #466

@0xpr03 0xpr03 added A-enhancement B-debouncer debouncer related labels Jan 28, 2023
@0xpr03 0xpr03 self-assigned this Jan 28, 2023
@0xpr03 0xpr03 marked this pull request as draft January 28, 2023 19:52
@0xpr03 0xpr03 force-pushed the debouncer_passive branch 3 times, most recently from c1feee8 to 1ce7060 Compare January 28, 2023 20:04
@0xpr03
Copy link
Member Author

0xpr03 commented Jan 28, 2023

cc @kchibisov

}
}

// // drain events channel
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we want this, it certainly allows us to receive rapid fired events.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that it'll provide any value? The "rapid fire" events will be handled by recv_timeout anyway just fine.

@0xpr03 0xpr03 force-pushed the debouncer_passive branch 11 times, most recently from 551dc86 to 0de9a72 Compare January 28, 2023 23:05
@0xpr03 0xpr03 marked this pull request as ready for review January 28, 2023 23:09
notify-debouncer-mini/src/lib.rs Show resolved Hide resolved
notify-debouncer-mini/src/lib.rs Outdated Show resolved Hide resolved
notify-debouncer-mini/src/lib.rs Outdated Show resolved Hide resolved
notify-debouncer-mini/src/lib.rs Show resolved Hide resolved
notify-debouncer-mini/src/lib.rs Show resolved Hide resolved
}
}

// // drain events channel

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that it'll provide any value? The "rapid fire" events will be handled by recv_timeout anyway just fine.

notify-debouncer-mini/src/lib.rs Outdated Show resolved Hide resolved
notify-debouncer-mini/src/lib.rs Outdated Show resolved Hide resolved
notify-debouncer-mini/src/lib.rs Outdated Show resolved Hide resolved
notify-debouncer-mini/src/lib.rs Outdated Show resolved Hide resolved
@0xpr03 0xpr03 force-pushed the debouncer_passive branch 3 times, most recently from 5051444 to bacc7c5 Compare February 2, 2023 02:00
@0xpr03 0xpr03 mentioned this pull request May 14, 2023
@0xpr03 0xpr03 force-pushed the debouncer_passive branch 2 times, most recently from 1febce8 to 08e685c Compare July 15, 2023 18:49
@0xpr03 0xpr03 force-pushed the debouncer_passive branch 5 times, most recently from ca4b2c3 to 9dd1e8c Compare July 15, 2023 19:52
Switches from active polling to an event loop that can fully sleep.
Also overhauls the configuration with a builder.
Bumps version to 0.4
@0xpr03
Copy link
Member Author

0xpr03 commented Jul 15, 2023

CC @dfaust because we'll have to retrofit this for the debouncer-full too (especially the semver breaking config change, to future proof additional config values)

@0xpr03 0xpr03 merged commit bba5469 into main Jul 15, 2023
12 checks passed
@0xpr03 0xpr03 deleted the debouncer_passive branch July 15, 2023 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

notify-debouncer-mini always does busy waiting
2 participants