Class SerializedExecutor

  • All Implemented Interfaces:

    public class SerializedExecutor
    extends java.lang.Object
    implements java.util.concurrent.Executor
    An executor than ensurers serial execution of submitted tasks.

    Callers of this execute will never block in the executor, but they may be required to either execute the task they submit or tasks submitted by other threads whilst they are executing tasks.

    This class was inspired by the public domain class NonBlockingMutexExecutor

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute​(java.lang.Runnable task)  
      protected void onError​(java.lang.Runnable task, java.lang.Throwable t)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SerializedExecutor

        public SerializedExecutor()
    • Method Detail

      • execute

        public void execute​(java.lang.Runnable task)
        Specified by:
        execute in interface java.util.concurrent.Executor
      • onError

        protected void onError​(java.lang.Runnable task,
                               java.lang.Throwable t)