Class SameThreadExecutorService

java.lang.Object
ch.raffael.meldioc.util.concurrent.SameThreadExecutorService
All Implemented Interfaces:
AutoCloseable, Executor, ExecutorService

public class SameThreadExecutorService extends Object implements ExecutorService
Executor that runs all tasks in the submitting thread.

It does, however, honor the contract of executor services. Several tasks can be run concurrently (when submitted from multiple threads), it doesn't accept any new work on shutdown, awaitTermination() waits until all tasks are done.