public class NonCancellable implements Job
A non-cancelable job that is always active. It is designed to be used with run builder to prevent cancellation of code blocks that need to run without cancellation.
Use it like this:
run(NonCancellable) {
// this code will not be cancelled
}
Job.DefaultImpls, Job.Key
Modifier and Type | Field and Description |
---|---|
static NonCancellable |
INSTANCE
A non-cancelable job that is always active. It is designed to be used with run builder
to prevent cancellation of code blocks that need to run without cancellation.
|
Modifier and Type | Method and Description |
---|---|
DisposableHandle |
attachChild(Job child)
Always returns
class NonDisposableHandle and does not do anything. |
boolean |
cancel(java.lang.Throwable cause)
Always returns
false . |
java.util.concurrent.CancellationException |
getCancellationException()
Always throws IllegalStateException.
|
kotlin.sequences.Sequence<kotlinx.coroutines.experimental.Job> |
getChildren()
Always returns emptySequence.
|
SelectClause0 |
getOnJoin()
Clause for select expression of join suspending function that selects when the job is complete.
This clause never fails, even if the job completes exceptionally.
|
DisposableHandle |
invokeOnCompletion(boolean onCancelling,
kotlin.jvm.functions.Function1<? super java.lang.Throwable,kotlin.Unit> handler)
Always returns
class NonDisposableHandle . |
boolean |
isActive()
Always returns
true . |
boolean |
isCancelled()
Always returns
false . |
boolean |
isCompleted()
Always returns
false . |
java.lang.Object |
join(kotlin.coroutines.experimental.Continuation<? super kotlin.Unit> $continuation)
Always throws UnsupportedOperationException.
|
boolean |
start()
Always returns
false . |
cancel, getCancellationException, getChildren, getOnJoin, invokeOnCompletion, isActive, isCancelled, isCompleted, join, start
public static NonCancellable INSTANCE
A non-cancelable job that is always active. It is designed to be used with run builder to prevent cancellation of code blocks that need to run without cancellation.
Use it like this:
run(NonCancellable) {
// this code will not be cancelled
}
public boolean isActive()
Always returns true
.
public boolean isCompleted()
Always returns false
.
public boolean isCancelled()
Always returns false
.
public boolean start()
Always returns false
.
public java.lang.Object join(kotlin.coroutines.experimental.Continuation<? super kotlin.Unit> $continuation)
Always throws UnsupportedOperationException.
public SelectClause0 getOnJoin()
Clause for select expression of join suspending function that selects when the job is complete. This clause never fails, even if the job completes exceptionally.
public java.util.concurrent.CancellationException getCancellationException()
Always throws IllegalStateException.
public DisposableHandle invokeOnCompletion(boolean onCancelling, kotlin.jvm.functions.Function1<? super java.lang.Throwable,kotlin.Unit> handler)
Always returns class NonDisposableHandle
.
class NonDisposableHandle
public boolean cancel(java.lang.Throwable cause)
Always returns false
.
public kotlin.sequences.Sequence<kotlinx.coroutines.experimental.Job> getChildren()
Always returns emptySequence.
public DisposableHandle attachChild(Job child)
Always returns class NonDisposableHandle
and does not do anything.
class NonDisposableHandle