WatchService questions

Alan Bateman Alan.Bateman at Sun.COM
Wed Jan 20 12:44:45 PST 2010


Sebastian Sickelmann wrote:
> Hi,
>
> in the attachment you can find the two Mercurial Exports. (Version 2A and Version2B)
>   
Thanks for updating the patches to ensure that the count isn't updated 
after the events have been retrieved. The approach in Version2B is 
probably better - as I mentioned in the previous mail, it will likely be 
a bit more efficient for the case that the user falls very behind, and 
there is a lot of activity, meaning many files being modified at around 
the same time that files are being created and deleted.

BTW, did you look at that link I sent you on the contributor agreement?

:
> I have found an additional interesting thing in WatchService. What are those Modifiers by the registering for. Should there be a Modifier to turn on the merging of MODIFY-Events?
> Maybe the Level of Merging (Version2A and Version2B)?
> It looks to me that the SensitivityModfies does some comparable feature than merging(reducing) MODIFY-Events.
>   
Modifiers are just an extension for the future so that we have a way to 
change how objects are registered. The API doesn't currently define any 
standard modifiers but you'll find two provider specific modifiers in 
the implementation. The modifier for the "sensitivity level" that you 
found is only interesting to the polling implementation (it is ignored 
by the other watch service implementations). If directories aren't 
polled very frequently then it's a bit like merging events although I'm 
not sure that it's worth adding a new modifier for this.

-Alan.


More information about the nio-dev mailing list