CheckStrategy enum
Defines the strategy used when evaluating multiple network targets during a check cycle.
When the engine is configured with multiple targets, the CheckStrategy determines
the logic for deciding the overall "connected" status of the network.
Values
- race → const CheckStrategy
-
The first target to respond successfully determines the result.
Behavior
In this mode, the engine initiates checks for all configured targets concurrently. As soon as a single target returns a successful response, the network is marked as "connected" and the engine returns the result immediately.
Use Case
This is the fastest strategy and is ideal for performance-sensitive applications where knowing any path to the internet is open is sufficient. It minimizes latency for the check itself.
- consensus → const CheckStrategy
-
A majority of targets must respond successfully for the check to be considered a success.
Behavior
The engine waits for a quorum of targets to respond. For example, if 3 targets are configured, at least 2 must succeed for the overall status to be "connected". If the majority fails, the network is considered "offline" or "unstable".
Use Case
This strategy provides high robustness against transient failures of specific servers (e.g., a specific DNS provider being down). It's best for critical applications that require high confidence in the network's reliability.
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<
CheckStrategy> - A constant List of the values in this enum, in order of their declaration.