public static class Delay.DefaultImpls
This dispatcher feature is implemented by class CoroutineDispatcher implementations that natively support
scheduled execution of tasks.
Implementation of this interface affects operation of delay and withTimeout functions.
class CoroutineDispatcher| Modifier and Type | Method and Description |
|---|---|
static java.lang.Object |
delay(Delay $this,
long time,
java.util.concurrent.TimeUnit unit,
kotlin.coroutines.experimental.Continuation<? super kotlin.Unit> p)
Delays coroutine for a given time without blocking a thread and resumes it after a specified time.
This suspending function is cancellable.
If the
interface Job of the current coroutine is cancelled or completed while this suspending function is waiting, this function
immediately resumes with CancellationException. |
static DisposableHandle |
invokeOnTimeout(Delay $this,
long time,
java.util.concurrent.TimeUnit unit,
java.lang.Runnable block)
Schedules invocation of a specified block after a specified delay time.
The resulting
interface DisposableHandle can be used to DisposableHandle.dispose of this invocation
request if it is not needed anymore. |
public static java.lang.Object delay(Delay $this, long time, java.util.concurrent.TimeUnit unit, kotlin.coroutines.experimental.Continuation<? super kotlin.Unit> p)
Delays coroutine for a given time without blocking a thread and resumes it after a specified time.
This suspending function is cancellable.
If the interface Job of the current coroutine is cancelled or completed while this suspending function is waiting, this function
immediately resumes with CancellationException.
interface Jobpublic static DisposableHandle invokeOnTimeout(Delay $this, long time, java.util.concurrent.TimeUnit unit, java.lang.Runnable block)
Schedules invocation of a specified block after a specified delay time.
The resulting interface DisposableHandle can be used to DisposableHandle.dispose of this invocation
request if it is not needed anymore.
This implementation uses a built-in single-threaded scheduled executor service.