code: public void executeInIoThread(Runnable task, boolean alwaysAsync) {
          if (!alwaysAsync && isIoThread()) {
              task.run();
          } else {
              registerTask(task);
          }
      }
docs: Execute the {@link Runnable} in a IO-Thread
  
  @param task
  the {@link Runnable} to execute
  @param alwaysAsync
  {@code true} if the {@link Runnable} should be executed
  in an async fashion even if the current Thread == IO Thread