dazinator/NetPack

Handle duplicate ChangeToken.OnChange better

Closed this issue · 0 comments

Need to work around this issue with the asp.net core framework, IFileProvider.Watch() signals its change token multiple times in quick succession if you save a change to a file: dotnet/aspnetcore#2542

I can write a helper method to wrap the listener, and when the change token is signalled, pause for a small period of time before invoking the listener. If during the pause a duplicate signalling of the change token occurs, I can extend the delay in a sliding mannor, such that the wrapped listener only gets called a single time.