All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.intellij.openapi.vfs.newvfs.persistent.FlushingDaemon Maven / Gradle / Ivy

Go to download

A packaging of the IntelliJ Community Edition platform-impl library. This is release number 1 of trunk branch 142.

The newest version!
/*
 * @author max
 */
package com.intellij.openapi.vfs.newvfs.persistent;

import com.intellij.util.ConcurrencyUtil;

import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class FlushingDaemon {
  private static final ScheduledThreadPoolExecutor pool = ConcurrencyUtil.newSingleScheduledThreadExecutor("Flushing thread");

  private FlushingDaemon() {}

  public static ScheduledFuture everyFiveSeconds(Runnable r) {
    return pool.scheduleWithFixedDelay(r, 5, 5, TimeUnit.SECONDS);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy