corda / net.corda.core.flows / FlowLogic / sleep


@Suspendable @JvmStatic @JvmOverloads fun sleep(duration: Duration, maySkipCheckpoint: Boolean = false): Unit

If on a flow, suspends the flow and only wakes it up after at least duration time has passed. Otherwise, just sleep for duration. This sleep function is not designed to aid scheduling, for which you should consider using net.corda.core.contracts.SchedulableState. It is designed to aid with managing contention for which you have not managed via another means.

Warning: long sleeps and in general long running flows are highly discouraged, as there is currently no support for flow migration! This method will throw an exception if you attempt to sleep for longer than 5 minutes.