Package com.jetbrains.rd.util.lifetime

Types

Link copied to clipboard
sealed class Lifetime
Link copied to clipboard
class LifetimeDefinition : Lifetime
Link copied to clipboard
enum LifetimeStatus : Enum<LifetimeStatus>

Lifetime's lifecycle statuses. Lifetime is created in Alive status and eventually becomes Terminated. Status change is one way road: from lower ordinal to higher (Alive ->Canceling ->Terminating ->Terminated).

Link copied to clipboard

Lifetime's termination timeout kind. The actual milliseconds value can be assigned via Lifetime.setTerminationTimeoutMs.

Link copied to clipboard
open class SequentialLifetimes(parentLifetime: Lifetime)

Functions

Link copied to clipboard
fun Lifetime.assertAlive()
Link copied to clipboard
fun Lifetime.intersect(lifetime: Lifetime): LifetimeDefinition

Creates an intersection of some lifetimes: new lifetime that terminate when either one terminates. Created lifetime inherits the smallest terminationTimeoutKind

Link copied to clipboard
fun Lifetime.onTermination(closeable: Closeable)
fun Lifetime.onTermination(action: () -> Unit)
Link copied to clipboard
operator fun Lifetime.plusAssign(action: () -> Unit)
Link copied to clipboard
fun Lifetime.throwIfNotAlive()
Link copied to clipboard
inline fun <T> Lifetime.view(viewable: IViewable<T>, crossinline handler: Lifetime.(T) -> Unit)
Link copied to clipboard
inline fun <T : Any> Lifetime.viewNotNull(viewable: IViewable<T?>, crossinline handler: Lifetime.(T) -> Unit)
Link copied to clipboard
fun Lifetime.waitTermination()

Properties

Link copied to clipboard
val EternalLifetime: Lifetime
Link copied to clipboard
val Lifetime.isAlive: Boolean
Link copied to clipboard
val Lifetime.isEternal: Boolean
Link copied to clipboard
val Lifetime.isNotAlive: Boolean