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

Repeated Events in FileMonitor #140

Closed
tobyweston opened this issue Apr 6, 2017 · 2 comments
Closed

Repeated Events in FileMonitor #140

tobyweston opened this issue Apr 6, 2017 · 2 comments
Labels

Comments

@tobyweston
Copy link

tobyweston commented Apr 6, 2017

I've encountered this as part of #137 but in the process method, it handles "repeated" events;

 repeat(event.count())(onEvent(event.kind(), target))

Given the docs

Returns the event count. If the event count is greater than {@code 1} then this is a repeated event.

and the gist of what-does-it-mean-for-an-event-to-be-repeated? talks about, I can't think why we want to fire multiple events like this.

Basically, I'm suggesting the following and wanted to make sure I'm not missing something.

 onEvent(event.kind(), target)

What do you think?

@pathikrit
Copy link
Owner

or even better, let the client handle it - will change signature to be onEvent(event.kind(), target, event.count())

pathikrit added a commit that referenced this issue Apr 7, 2017
Fix #140: Rollup events for file monitor
@tobyweston
Copy link
Author

Might be nice to offer both, have override def onCreate(file: File, count: Int) = {} default to calling the onCreate with an argument of 1? Or use a default value of 1?

override def onCreate(file: File, count: Int, count: Int = 1) = ...

I'm thinking to avoid an API breaking change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants