Skip to content

Conversation

@sungshik
Copy link
Contributor

@sungshik sungshik commented Feb 21, 2025

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
Copy link

codecov bot commented Feb 21, 2025

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 lines Patch % Lines
.../engineering/swat/watch/impl/jdk/JDKFileWatch.java 0.0% 2 Missing ⚠️
...wat/watch/impl/jdk/JDKRecursiveDirectoryWatch.java 0.0% 2 Missing ⚠️
.../engineering/swat/watch/impl/jdk/JDKBaseWatch.java 66.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.

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

@DavyLandman DavyLandman left a comment

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
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
Contributor Author

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.

@sungshik sungshik changed the title Improved overflow support: Enriched ActiveWatch interface Improved overflow support: Added internal EventHandlingWatch interface Feb 24, 2025
@sungshik sungshik changed the title Improved overflow support: Added internal EventHandlingWatch interface Improved overflow support: Internal EventHandlingWatch interface Feb 24, 2025
Copy link
Member

@DavyLandman DavyLandman left a comment

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-main Feb 24, 2025
13 checks passed
@sungshik sungshik deleted the improved-overflow-support/richer-active-watch branch February 24, 2025 11:20
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

Successfully merging this pull request may close these issues.

2 participants