public class ScheduledKt
| Modifier and Type | Method and Description | 
|---|---|
| static <T> java.lang.Object | withTimeout(int time,
           kotlin.jvm.functions.Function2<? super kotlinx.coroutines.experimental.CoroutineScope,? super kotlin.coroutines.experimental.Continuation<? super T>,? extends java.lang.Object> block,
           kotlin.coroutines.experimental.Continuation<? super T> p)Runs a given suspending block of code inside a coroutine with a specified timeout and throws
 exception TimeoutCancellationExceptionif timeout was exceeded. | 
| static <T> java.lang.Object | withTimeout(long time,
           java.util.concurrent.TimeUnit unit,
           kotlin.jvm.functions.Function2<? super kotlinx.coroutines.experimental.CoroutineScope,? super kotlin.coroutines.experimental.Continuation<? super T>,? extends java.lang.Object> block,
           kotlin.coroutines.experimental.Continuation<? super T> p)Runs a given suspending block of code inside a coroutine with a specified timeout and throws
 exception TimeoutCancellationExceptionif timeout was exceeded. | 
| static <T> java.lang.Object | withTimeoutOrNull(int time,
                 kotlin.jvm.functions.Function2<? super kotlinx.coroutines.experimental.CoroutineScope,? super kotlin.coroutines.experimental.Continuation<? super T>,? extends java.lang.Object> block,
                 kotlin.coroutines.experimental.Continuation<? super T> p)Runs a given suspending block of code inside a coroutine with a specified timeout and returns
 nullif this timeout was exceeded. | 
| static <T> java.lang.Object | withTimeoutOrNull(long time,
                 java.util.concurrent.TimeUnit unit,
                 kotlin.jvm.functions.Function2<? super kotlinx.coroutines.experimental.CoroutineScope,? super kotlin.coroutines.experimental.Continuation<? super T>,? extends java.lang.Object> block,
                 kotlin.coroutines.experimental.Continuation<? super T> p)Runs a given suspending block of code inside a coroutine with a specified timeout and returns
 nullif this timeout was exceeded. | 
public static <T> java.lang.Object withTimeout(int time,
                                               kotlin.jvm.functions.Function2<? super kotlinx.coroutines.experimental.CoroutineScope,? super kotlin.coroutines.experimental.Continuation<? super T>,? extends java.lang.Object> block,
                                               kotlin.coroutines.experimental.Continuation<? super T> p)
Runs a given suspending block of code inside a coroutine with a specified timeout and throws
exception TimeoutCancellationException if timeout was exceeded.
The code that is executing inside the block is cancelled on timeout and the active or next invocation of
cancellable suspending function inside the block throws exception TimeoutCancellationException.
Even if the code in the block suppresses exception TimeoutCancellationException, it
is still thrown by withTimeout invocation.
The sibling function that does not throw exception on timeout is ScheduledKt.withTimeoutOrNull.
Note, that timeout action can be specified for select invocation with SelectBuilder.onTimeout clause.
This function delegates to Delay.invokeOnTimeout if the context class CoroutineDispatcher
implements interface Delay interface, otherwise it tracks time using a built-in single-threaded scheduled executor service.
time - timeout time in milliseconds.exception TimeoutCancellationException, 
exception TimeoutCancellationException, 
exception TimeoutCancellationException, 
ScheduledKt.withTimeoutOrNull, 
SelectBuilder.onTimeout, 
Delay.invokeOnTimeout, 
class CoroutineDispatcher, 
interface Delaypublic static <T> java.lang.Object withTimeout(long time,
                                               java.util.concurrent.TimeUnit unit,
                                               kotlin.jvm.functions.Function2<? super kotlinx.coroutines.experimental.CoroutineScope,? super kotlin.coroutines.experimental.Continuation<? super T>,? extends java.lang.Object> block,
                                               kotlin.coroutines.experimental.Continuation<? super T> p)
Runs a given suspending block of code inside a coroutine with a specified timeout and throws
exception TimeoutCancellationException if timeout was exceeded.
The code that is executing inside the block is cancelled on timeout and the active or next invocation of
cancellable suspending function inside the block throws exception TimeoutCancellationException.
Even if the code in the block suppresses exception TimeoutCancellationException, it
is still thrown by withTimeout invocation.
The sibling function that does not throw exception on timeout is ScheduledKt.withTimeoutOrNull.
Note, that timeout action can be specified for select invocation with SelectBuilder.onTimeout clause.
This function delegates to Delay.invokeOnTimeout if the context class CoroutineDispatcher
implements interface Delay interface, otherwise it tracks time using a built-in single-threaded scheduled executor service.
time - timeout timeunit - timeout unit (milliseconds by default)exception TimeoutCancellationException, 
exception TimeoutCancellationException, 
exception TimeoutCancellationException, 
ScheduledKt.withTimeoutOrNull, 
SelectBuilder.onTimeout, 
Delay.invokeOnTimeout, 
class CoroutineDispatcher, 
interface Delaypublic static <T> java.lang.Object withTimeoutOrNull(int time,
                                                     kotlin.jvm.functions.Function2<? super kotlinx.coroutines.experimental.CoroutineScope,? super kotlin.coroutines.experimental.Continuation<? super T>,? extends java.lang.Object> block,
                                                     kotlin.coroutines.experimental.Continuation<? super T> p)
Runs a given suspending block of code inside a coroutine with a specified timeout and returns
null if this timeout was exceeded.
The code that is executing inside the block is cancelled on timeout and the active or next invocation of
cancellable suspending function inside the block throws exception TimeoutCancellationException.
NB: this method is exception-unsafe. Even if the code in the block suppresses exception TimeoutCancellationException, this
invocation of withTimeoutOrNull still returns null and thrown exception will be ignored.
The sibling function that throws exception on timeout is ScheduledKt.withTimeout.
Note, that timeout action can be specified for select invocation with SelectBuilder.onTimeout clause.
This function delegates to Delay.invokeOnTimeout if the context class CoroutineDispatcher
implements interface Delay interface, otherwise it tracks time using a built-in single-threaded scheduled executor service.
time - timeout time in milliseconds.exception TimeoutCancellationException, 
exception TimeoutCancellationException, 
ScheduledKt.withTimeout, 
SelectBuilder.onTimeout, 
Delay.invokeOnTimeout, 
class CoroutineDispatcher, 
interface Delaypublic static <T> java.lang.Object withTimeoutOrNull(long time,
                                                     java.util.concurrent.TimeUnit unit,
                                                     kotlin.jvm.functions.Function2<? super kotlinx.coroutines.experimental.CoroutineScope,? super kotlin.coroutines.experimental.Continuation<? super T>,? extends java.lang.Object> block,
                                                     kotlin.coroutines.experimental.Continuation<? super T> p)
Runs a given suspending block of code inside a coroutine with a specified timeout and returns
null if this timeout was exceeded.
The code that is executing inside the block is cancelled on timeout and the active or next invocation of
cancellable suspending function inside the block throws exception TimeoutCancellationException.
NB: this method is exception-unsafe. Even if the code in the block suppresses exception TimeoutCancellationException, this
invocation of withTimeoutOrNull still returns null and thrown exception will be ignored.
The sibling function that throws exception on timeout is ScheduledKt.withTimeout.
Note, that timeout action can be specified for select invocation with SelectBuilder.onTimeout clause.
This function delegates to Delay.invokeOnTimeout if the context class CoroutineDispatcher
implements interface Delay interface, otherwise it tracks time using a built-in single-threaded scheduled executor service.
time - timeout timeunit - timeout unit (milliseconds by default)exception TimeoutCancellationException, 
exception TimeoutCancellationException, 
ScheduledKt.withTimeout, 
SelectBuilder.onTimeout, 
Delay.invokeOnTimeout, 
class CoroutineDispatcher, 
interface Delay