Skip to content

Improved overflow support: Internal EventHandlingWatch interface - #19

Merged
sungshik merged 7 commits into
improved-overflow-support-mainfrom
improved-overflow-support/richer-active-watch
Feb 24, 2025
Merged

Improved overflow support: Internal EventHandlingWatch interface#19
sungshik merged 7 commits into
improved-overflow-support-mainfrom
improved-overflow-support/richer-active-watch

Conversation

@sungshik

@sungshiksungshik commented Feb 21, 2025

Copy link
Copy Markdown
Contributor

This PR adds a new internal interface, EventHandlingWatch, which extends the existing external interface ActiveWatch. In the next PRs, EventHandlingWatch will be generically used as a type in overflow event handlers instead of JDK...Watch. That's useful because these overflow handlers may also be used by non-JDK watches.

@codecov

codecovBot commented Feb 21, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 61.53846% with 5 lines in your changes missing coverage. Please review.

Project coverage is 80.3%. Comparing base (53f3038) to head (9807fdb).
Report is 8 commits behind head on improved-overflow-support-main.

Files with missing linesPatch %Lines
.../engineering/swat/watch/impl/jdk/JDKFileWatch.java0.0%2 Missing ⚠️
...wat/watch/impl/jdk/JDKRecursiveDirectoryWatch.java0.0%2 Missing ⚠️
.../engineering/swat/watch/impl/jdk/JDKBaseWatch.java66.6%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## improved-overflow-support-main #19 +/- ##
==================================================================
- Coverage 80.5% 80.3% -0.2% - Complexity 91 94 +3 
==================================================================
Files 11 12 +1 Lines 416 428 +12 Branches 41 41 ==================================================================
+ Hits 335 344 +9 - Misses 59 61 +2 - Partials 22 23 +1 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sungshiksungshik mentioned this pull request Feb 24, 2025
7 tasks
@sungshiksungshik changed the title Improved overflow support: Enrich ActiveWatchImproved overflow support: Enriched ActiveWatch interfaceFeb 24, 2025
@sungshik
sungshik marked this pull request as ready for review February 24, 2025 09:01

@DavyLandmanDavyLandman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I want to keep ActiveWatch as small and focussed as possible.

* file system libraries trigger the event handler "from the inside"). This
* is useful to report synthetic events (e.g., while handling overflows).
*/
void handleEvent(WatchEvent event);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In a public interface, this feels a bit weird, I want to keep this interface as small as possible, to allow us to improve the API without breaking compatibility.

Maybe this should be an internal/private interface?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Agreed. I've extracted handleEvent and relativize into a separate interface in the impl package, called EventHandlingWatch.

Comment threadsrc/main/java/engineering/swat/watch/ActiveWatch.java
Comment threadsrc/main/java/engineering/swat/watch/ActiveWatch.java Outdated
@sungshiksungshik changed the title Improved overflow support: Enriched ActiveWatch interfaceImproved overflow support: Added internal EventHandlingWatch interfaceFeb 24, 2025
@sungshiksungshik changed the title Improved overflow support: Added internal EventHandlingWatch interfaceImproved overflow support: Internal EventHandlingWatch interfaceFeb 24, 2025

@DavyLandmanDavyLandman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Much better 👍🏼

@sungshik
sungshik merged commit 8d4dd06 into improved-overflow-support-mainFeb 24, 2025
@sungshik
sungshik deleted the improved-overflow-support/richer-active-watch branch February 24, 2025 11:20
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@sungshik@DavyLandman