Execute the runnable in the main thread of the underlying RPC endpoint, with
a delay of the given number of milliseconds.

@param runnable Runnable to be executed
@param delay    The delay after which the runnable will be executed
486355
protected void scheduleRunAsync(Runnable runnable, long delay, TimeUnit unit) {
		rpcServer.scheduleRunAsync(runnable, unit.toMillis(delay));
	}
1257328
void invokeAndWait(final Runnable r) {
        final CountDownLatch latch = new CountDownLatch(1);
        queue.postRunnable(() -> {
            try {
                r.run();
            } finally {
                latch.countDown();
            }
        });
        try {
            latch.await();
        } catch (InterruptedException e) { }
    }
595245
public static void asyncExecute(Runnable runnable) {
		if (runnable != null) {
			try {
				Para.getExecutorService().execute(runnable);
			} catch (RejectedExecutionException ex) {
				logger.warn(ex.getMessage());
				try {
					runnable.run();
				} catch (Exception e) {
					logger.error(null, e);
				}
			}
		}
	}
218547
public <T extends Runnable> T executeSync(T runnable) {
		synchronized (runnable) {
			this.executeAsync(runnable);
			try {
				runnable.wait();
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}

		return runnable;
	}
227710
public static void execute(Runnable runnable) {
		try {
			executor.execute(runnable);
		} catch (Exception e) {
			throw new UtilException(e, "Exception when running task!");
		}
	}
921145
public <T extends Runnable> T executeAsync(T runnable) {
		synchronized (this.tasks) {
			this.tasks.add(runnable);
			// Notify that a task has been added
			this.tasks.notifyAll();

			if (this.tasks.size() == 1) {
				this.onTaskBecameNotEmpty();
			}

			this.onTaskAdded();
		}
		return runnable;
	}
908686
public ScheduledFuture<?> executePeriodically(Runnable command, long delay)
   {
      return executor.scheduleWithFixedDelay(command, 0, delay, TimeUnit.MILLISECONDS);
   }
451060
public void run(ExceptionalRunnable runnable) throws Exception {
		initStartTotal();
		long startInvokation = System.currentTimeMillis();
		runnable.run();
		invoked(System.currentTimeMillis() - startInvokation);
	}
872887
public ServerListenerBuilder addStartedCallback(Runnable runnable) {
        requireNonNull(runnable, "runnable");
        serverStartedCallbacks.add(unused -> runnable.run());
        return this;
    }
1018812
public void setHintDelayed(@StringRes final int hintResource, long delayMilliseconds) {
        final Runnable hintRunnable = new Runnable() {
            @Override
            public void run() {
                setHint(hintResource);
            }
        };
        mHandler.postDelayed(hintRunnable, delayMilliseconds);
    }
1022685
@Weight(Weight.Unit.NORMAL)
  public static Runnable defer(@Nonnull final Runnable runnable) {
    assertNotNull(runnable);
    defer(new Deferred() {
      private static final long serialVersionUID = 2061489024868070733L;
      private final Runnable value = runnable;

      @Override
      public void executeDeferred() throws Exception {
        this.value.run();
      }
    });
    return runnable;
  }
1238387
protected void scheduleRunAsync(Runnable runnable, long delay, TimeUnit unit) {
		componentMainThreadExecutor.schedule(runnable, delay, unit);
	}
159874
@Override
  public void execute(Runnable r) {
    runQueue.add(checkNotNull(r, "'r' must not be null."));
    schedule(r);
  }
207362
public static ScheduledFuture<?> schedule(Runnable runnable, Duration runFrequency, TimerType timerType)
	{
		switch (timerType)
		{
		case OneTimeRun:
			return executor.schedule(runnable, runFrequency.toMillis(), TimeUnit.MILLISECONDS);

		case RepeatRun:
			return executor.scheduleWithFixedDelay(runnable, runFrequency.toMillis(), runFrequency.toMillis(), TimeUnit.MILLISECONDS);

		default:
			throw new UnsupportedOperationException("Unsupported timer pattern.");
		}
	}
416740
@Deprecated
    public void sync(final Runnable runnable) {
        clientConnector.send(new EmptyCommand(), new OnFinishedHandler() {
            public void onFinished() {
                runnable.run();
            }

        });
    }
749594
@Override
    public Thread newThread(Runnable runnable) {
        Thread thread = new Thread(runnable);
        thread.setPriority(threadPriority);
        return thread;
    }
991128
@Api
	public void runWhenInitialized(Runnable runnable) {
		if (isInitialized()) {
			runnable.run();
		} else {
			whenInitializedRunnables.add(runnable);
		}
	}