/** * Queues the given task to be called after roughly the number of seconds given here. * <p> * In contrast to {@link #callDelayed(String, long, Runnable)}, this will preserve the {@link CallContext} when * invoking the <tt>task</tt>. * </p> * * @param executor the executor to execute the task in. Use {@link Tasks#DEFAULT} is no other appropriate * pool * is available. * @param delayInSeconds the number to wait in seconds. Note that the delay can be a bit longer, depending on the * system load. * @param task the task to execute */ public void forkDelayed(@Nonnull String executor, long delayInSeconds, @Nonnull Runnable task) { CallContext currentContext = CallContext.getCurrent(); callDelayed(executor, delayInSeconds, () -> { CallContext backup = CallContext.getCurrent(); try { CallContext.setCurrent(currentContext); task.run(); } finally { CallContext.setCurrent(backup); } }); }