I want to perform some cleaning when the object is removed from guava cache. But I need to do it after some time. Can I put sleep there? Will it block all threads? Or removalListener runs in a separate thread?
CacheBuilder.newBuilder().
.removalListener(notification -> {
try {
Thread.sleep(10 * 60 * 1000);
} catch (InterruptedException e) {
}
try {
//close
} catch (final IOException e) {
}
})
.build();