Skip to content

Instantly share code, notes, and snippets.

@wpc009
Last active December 13, 2016 08:02
Show Gist options
  • Select an option

  • Save wpc009/38db37f94b1059edeb6db0df44d63249 to your computer and use it in GitHub Desktop.

Select an option

Save wpc009/38db37f94b1059edeb6db0df44d63249 to your computer and use it in GitHub Desktop.
  • How to Create ExecutorService
ExecutorService es = new ForkJoinPool(2, new ForkJoinPool.ForkJoinWorkerThreadFactory() {
        @Override
        public ForkJoinWorkerThread newThread(ForkJoinPool pool) {
            ForkJoinWorkerThread thread = new ForkJoinWorkerThread(pool);
            return thread;
        }
    }, new Thread.UncaughtExceptionHandler() {
        @Override
        public void uncaughtException(Thread t, Throwable e) {
        }
    }, true);
  • How to customize akka dispatcher
ActorSystem("sys",Some(config),None,Some(ExecutionContext.fromExecutorService(exectorService)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment