ReadinessState enum

Represents the readiness state of an application.

A readiness state indicates whether the application is prepared to accept new traffic. Most commonly used in "readiness probes" or /ready endpoints, this enum helps orchestrators like Kubernetes decide whether a service instance should be included in load balancing.

When to use:

  • Determining whether the application has completed startup
  • Blocking incoming traffic during initialization
  • Temporarily removing an instance from rotation

Example:

if (state == ReadinessState.ACCEPTING_TRAFFIC) {
  // Ready to receive requests
}
Inheritance
Implemented types
Available extensions

Values

ACCEPTING_TRAFFIC → const ReadinessState

The application is fully initialized and able to accept incoming traffic.

REFUSING_TRAFFIC → const ReadinessState

The application is not currently able to receive traffic.

This may occur during:

  • Startup sequences
  • Maintenance or reconfiguration
  • Temporary degraded states
  • Graceful shutdown

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<ReadinessState>
A constant List of the values in this enum, in order of their declaration.