W3cubDocs

/Kotlin

Future

Platform and version requirements: Native (1.3)
inline class Future<T>

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

Properties

Platform and version requirements: Native (1.3)

id

val id: Int
Platform and version requirements: Native (1.3)

result

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

val result: T
Platform and version requirements: Native (1.3)

state

A FutureState of this future

val state: FutureState

Functions

Platform and version requirements: Native (1.3)

consume

Blocks execution until the future is ready.

fun <R> consume(code: (T) -> R): R
Platform and version requirements: Native (1.3)

toString

Returns a string representation of the object.

fun toString(): String

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native.concurrent/-future/index.html