|
C++ Server-Side SDK
LaunchDarkly SDK
|
#include <ifdv2_condition.hpp>

Public Types | |
| enum class | Type { kFallback , kRecovery , kCancelled } |
Public Member Functions | |
| virtual async::Future< Type > | Execute ()=0 |
| virtual void | Inform (FDv2SourceResult const &result)=0 |
| virtual void | Close ()=0 |
| virtual Type | GetType () const =0 |
| IFDv2Condition (IFDv2Condition const &)=delete | |
| IFDv2Condition (IFDv2Condition &&)=delete | |
| IFDv2Condition & | operator= (IFDv2Condition const &)=delete |
| IFDv2Condition & | operator= (IFDv2Condition &&)=delete |
A condition observes the orchestrator's stream of synchronizer results and fires when criteria for a synchronizer transition are met.
Each condition plays one of two roles, identified by Type():
Conditions are stateful: the orchestrator pushes results into a condition via Inform() so the condition can update its internal state (typically a timer). When the condition's criteria are satisfied, the future returned by Execute() resolves with the condition's Type.
Conditions are single-use: once fired, they are not re-armed. The orchestrator builds a fresh condition for each synchronizer activation via an IFDv2ConditionFactory.
Close() cancels any pending internal work (e.g., a timer) and resolves the future with kCancelled.
Implementations must be thread-safe: Execute, Inform, Close, and GetType may be called from any thread.
| Enumerator | |
|---|---|
| kFallback | Stop the active synchronizer and start the next-preferred one. |
| kRecovery | Return to the most-preferred synchronizer. |
| kCancelled | The condition was Close()d before firing; orchestrator ignores. |
|
pure virtual |
Cancels any pending internal work and resolves the future returned by Execute() with kCancelled if it has not already resolved. Idempotent.
Implemented in launchdarkly::server_side::data_systems::TimedCondition.
|
pure virtual |
Returns a Future that resolves with the condition's Type once the condition's criteria are satisfied. May be called multiple times; each call returns a Future referring to the same underlying state.
Implemented in launchdarkly::server_side::data_systems::TimedCondition.
|
pure virtual |
Returns the condition's role in the orchestrator.
Implemented in launchdarkly::server_side::data_systems::RecoveryCondition, and launchdarkly::server_side::data_systems::FallbackCondition.
|
pure virtual |
Pushes a synchronizer result into the condition so it can update any internal state (e.g., arm or cancel a timer).
Implemented in launchdarkly::server_side::data_systems::RecoveryCondition, and launchdarkly::server_side::data_systems::FallbackCondition.