Add DelayedExecutorService#instantExec
This commit is contained in:
parent
c392f6e80c
commit
112beb7284
1 changed files with 6 additions and 2 deletions
|
@ -27,7 +27,7 @@ public class DelayedExecutorService {
|
||||||
public void run() {
|
public void run() {
|
||||||
DelayedExecutorService.getInstance().onTick();
|
DelayedExecutorService.getInstance().onTick();
|
||||||
}
|
}
|
||||||
}, 1L, 1L, TimeUnit.SECONDS);
|
}, 250L, 250L, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
private DelayedExecutorService(){}
|
private DelayedExecutorService(){}
|
||||||
|
|
||||||
|
@ -99,6 +99,11 @@ public class DelayedExecutorService {
|
||||||
//EXECUTORS.add(new DelayedExecution(run, unix));
|
//EXECUTORS.add(new DelayedExecution(run, unix));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void instantExec(final Task run)
|
||||||
|
{
|
||||||
|
repeater.execute(run);
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isRunning()
|
public static boolean isRunning()
|
||||||
{
|
{
|
||||||
return RUN.get();
|
return RUN.get();
|
||||||
|
@ -122,7 +127,6 @@ public class DelayedExecutorService {
|
||||||
|
|
||||||
private static void stopRepeatingThread()
|
private static void stopRepeatingThread()
|
||||||
{
|
{
|
||||||
repeater.shutdown();
|
|
||||||
repeater.shutdownNow();
|
repeater.shutdownNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue