Module handlerannotations
Class ImmediateExecutorService
- java.lang.Object
-
- java.util.concurrent.AbstractExecutorService
-
- com.ensarsarajcic.neovim.java.handler.ImmediateExecutorService
-
- All Implemented Interfaces:
java.util.concurrent.Executor,java.util.concurrent.ExecutorService
public final class ImmediateExecutorService extends java.util.concurrent.AbstractExecutorServiceSimple implementation ofExecutorServicewhich runs all tasks on thread the call was made fromThis is useful as a quick implementation, and should be used only when blocking is fine
-
-
Constructor Summary
Constructors Constructor Description ImmediateExecutorService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanawaitTermination(long timeout, java.util.concurrent.TimeUnit unit)No-opvoidexecute(java.lang.Runnable command)Immediately runs the passed command, unless shutdown flag is set If shutdown flag is set, this is a no-opbooleanisShutdown()Returns the shutdown flag set byshutdown()andshutdownNow()booleanisTerminated()Returns the shutdown flag set byshutdown()andshutdownNow()voidshutdown()Sets the shutdown flag just forisShutdown()andisTerminated()methodsjava.util.List<java.lang.Runnable>shutdownNow()Returns an empty list of runnables, since it can't hold any and sets the same flag asshutdown()
-
-
-
Method Detail
-
shutdown
public void shutdown()
Sets the shutdown flag just forisShutdown()andisTerminated()methods
-
shutdownNow
public java.util.List<java.lang.Runnable> shutdownNow()
Returns an empty list of runnables, since it can't hold any and sets the same flag asshutdown()- Returns:
- an empty list
-
isShutdown
public boolean isShutdown()
Returns the shutdown flag set byshutdown()andshutdownNow()- Returns:
- shutdown flag
-
isTerminated
public boolean isTerminated()
Returns the shutdown flag set byshutdown()andshutdownNow()- Returns:
- shutdown flag
-
awaitTermination
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedExceptionNo-op- Returns:
- true
- Throws:
java.lang.InterruptedException
-
execute
public void execute(java.lang.Runnable command)
Immediately runs the passed command, unless shutdown flag is set If shutdown flag is set, this is a no-op- Parameters:
command- to run
-
-