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).

Entries

Link copied to clipboard

Lifetime is ready to use. Every lifetime's method will work.

Link copied to clipboard

This status propagates instantly through all lifetime's children graph when LifetimeDefinition.terminate is invoked. Lifetime is in consistent state (no resources are terminated) but termination process is already began. All background activities that block termination (e.g. started with Lifetime.executeOrThrow, should be interrupted as fast as possible. That's why background activities must check Lifetime.isAlive or Lifetime.throwIfNotAlive quite ofter (200 ms is a good reference value).

Link copied to clipboard

Lifetime is in inconsistent state. Destruction begins: some resources are terminated, other not. All method throw exception or do nothing (e.g. Lifetime.onTerminationIfAlive).

Link copied to clipboard

Lifetime is fully terminated, all resources are disposed and method's behavior is the same as in Terminating state.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.