Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I needed an implementation of debounce in Java recently and was surprised to find out that there's no existing decent solution - there's none from the standard library, nor popular utilities libraries like Guava or Apache Commons. There are some implementations floating around like on Stackoverflow but I found them lacking, either there's no thread safety or there's no flexibility in supporting the execution of the task at the leading edge or trailing edge or both. Anyone has a good recommendation on a good implementation?


Maybe searching for throttling return more relevant results? For that there are multiple libraries (e.g. resiliance4j), but you can easily write one yourself as well with a ring buffer.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: