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 ExecutionException cause.

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
cancel(interruptIfRunning: Boolean)
R!
R!
@UnknownNull
get(timeout: Long, unit: TimeUnit!)
Boolean
Boolean
Unit
run()

Protected functions

Unit

Cancels any work being done by doWork.

abstract R!

Performs the work or computation.

Protected constructors

RunnableFutureTask

protected RunnableFutureTask()

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.

cancel

fun cancel(interruptIfRunning: Boolean): Boolean

isCancelled

fun isCancelled(): Boolean

isDone

fun isDone(): Boolean

run

fun run(): Unit

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.