net.corda.node.utilities / AffinityExecutor / executeASAP

executeASAP

open fun executeASAP(runnable: () -> Unit): Unit

If isOnThread() then runnable is invoked immediately, otherwise the closure is queued onto the backing thread.