LivenessState enum
Represents the liveness state of an application.
A liveness state indicates whether the application is alive and functioning. Unlike readiness checks, liveness checks reveal whether the application needs to be restarted due to an unrecoverable failure.
Commonly used in "liveness probes" or /live endpoints.
If an application reports BROKEN, orchestrators typically restart it.
Example:
if (state == LivenessState.BROKEN) {
// Application requires restart
}
- Inheritance
- Implemented types
- Available extensions
Values
- BROKEN → const LivenessState
-
The application has entered a broken or unrecoverable state.
Triggering this state typically instructs orchestration environments to restart the service instance.
- ACTIVE → const LivenessState
-
The application is alive and functioning normally.
This indicates that the process is responsive and not in a deadlocked or irrecoverable condition.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
LivenessState> - A constant List of the values in this enum, in order of their declaration.