Class SimpleThread

All Implemented Interfaces:
Runnable

public class SimpleThread extends BaseWorkThread<SimpleThreadHandler>
General thread class for simple solutions
  • Constructor Details

    • SimpleThread

      public SimpleThread(@NonNull String threadName)
      Create an instance of the SimpleThread
      Parameters:
      threadName - name of the current thread
  • Method Details

    • constructHandler

      @NonNull protected SimpleThreadHandler constructHandler()
      Specified by:
      constructHandler in class BaseWorkThread<SimpleThreadHandler>
    • runAsync

      public void runAsync(Runnable runnable)
      Add a task to the queue and run the task asynchronously
    • runAndWaitForResult

      @Nullable public <T> T runAndWaitForResult(Callable<T> callable)
      Add a task to the queue and wait when task will be completed
      Returns:
      result of the task
    • runAndWaitForFinish

      public void runAndWaitForFinish(Runnable runnable)
      Add a task to the queue and wait when task will be completed