Future

inline class Future<T>

Class representing abstract computation, whose result may become available in the future.

Functions

consume
Link copied to clipboard
inline fun <R> consume(code: (T) -> R): R

Blocks execution until the future is ready.

toString
Link copied to clipboard
open override fun toString(): String

Properties

id
Link copied to clipboard
val id: Int
result
Link copied to clipboard
val result: T

The result of the future computation. Blocks execution until the future is ready. Second attempt to get will result in an error.

state
Link copied to clipboard
val state: FutureState

A FutureState of this future