Package aQute.lib.concurrent.serial
Class SerialExecutor
- java.lang.Object
-
- aQute.lib.concurrent.serial.SerialExecutor
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class SerialExecutor extends java.lang.Object implements java.lang.AutoCloseable
Will execute a set of tasks in order of submit.
-
-
Constructor Summary
Constructors Constructor Description SerialExecutor(java.util.concurrent.Executor executor)
The executor to use.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
run(java.lang.Runnable runnable)
Run the runnable in order of submission.<T> org.osgi.util.promise.Promise<T>
submit(java.util.concurrent.Callable<T> callable)
Run serial in order of submission and return a promise
-
-
-
Method Detail
-
submit
public <T> org.osgi.util.promise.Promise<T> submit(java.util.concurrent.Callable<T> callable)
Run serial in order of submission and return a promise- Type Parameters:
T
- the return type- Parameters:
callable
- the callable providing the data- Returns:
- the promise
-
run
public void run(java.lang.Runnable runnable)
Run the runnable in order of submission.- Parameters:
runnable
- the runnable
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-