RunnableFutureTask
@UnstableApi
abstract class RunnableFutureTask<R, E : Exception?> : RunnableFuture
A RunnableFuture that supports additional uninterruptible operations to query whether execution has started and finished.
| Parameters | |
|---|---|
<R> |
The type of the result. |
<E : Exception?> |
The type of any |
Summary
Protected constructors |
|---|
Public functions |
|
|---|---|
Unit |
Blocks until the task has finished, or has been canceled without having been started. |
Unit |
Blocks until the task has started, or has been canceled without having been started. |
Boolean |
|
R! |
|
R! |
@UnknownNull |
Boolean |
|
Boolean |
isDone() |
Unit |
run() |
Protected functions |
|
|---|---|
Unit |
Cancels any work being done by |
abstract R! |
Performs the work or computation. |
Inherited functions |
||||||
|---|---|---|---|---|---|---|
|
Protected constructors
Public functions
blockUntilFinished
fun blockUntilFinished(): Unit
Blocks until the task has finished, or has been canceled without having been started.
blockUntilStarted
fun blockUntilStarted(): Unit
Blocks until the task has started, or has been canceled without having been started.
Protected functions
cancelWork
protected fun cancelWork(): Unit
Cancels any work being done by doWork. If doWork is currently executing then the thread on which it's executing may be interrupted immediately after this method returns.
The default implementation does nothing.
doWork
@UnknownNull
protected abstract fun doWork(): R!
Performs the work or computation.
| Returns | |
|---|---|
R! |
The computed result. |
| Throws | |
|---|---|
E |
If an error occurred. |