Java Thread Executor Execute invokeOnBackgroundThread(Runnable runnable)

Here you can find the source of invokeOnBackgroundThread(Runnable runnable)

Description

invoke On Background Thread

License

Open Source License

Declaration

public static void invokeOnBackgroundThread(Runnable runnable) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Main {
    public static void invokeOnBackgroundThread(Runnable runnable) {
        ExecutorService executor = Executors.newSingleThreadExecutor();
        executor.execute(runnable);/*from w  ww  .  ja  v  a  2s.c  om*/
        executor.shutdown();
    }
}

Related

  1. executeParallel(final List> callables, final int maxThreadCount)
  2. executePeriodicallyInThread(Runnable r, int delay, int period, TimeUnit unit)
  3. ExecuteThreads(ArrayList threads, int nThreads)
  4. invokeAsync(Runnable runnable)
  5. invokeLater(Runnable runnable)
  6. run(Runnable target)
  7. runConcurrently(final Runnable[] threads)
  8. runConcurrently(Runnable... tasks)
  9. runInBackground(final Runnable task)