C++ Server-Side SDK
LaunchDarkly SDK
Public Types | Public Member Functions | List of all members
launchdarkly::server_side::data_interfaces::IFDv2Condition Class Referenceabstract

#include <ifdv2_condition.hpp>

Inheritance diagram for launchdarkly::server_side::data_interfaces::IFDv2Condition:
Inheritance graph
[legend]

Public Types

enum class  Type { kFallback , kRecovery , kCancelled }
 

Public Member Functions

virtual async::Future< TypeExecute ()=0
 
virtual void Inform (FDv2SourceResult const &result)=0
 
virtual void Close ()=0
 
virtual Type GetType () const =0
 
 IFDv2Condition (IFDv2Condition const &)=delete
 
 IFDv2Condition (IFDv2Condition &&)=delete
 
IFDv2Conditionoperator= (IFDv2Condition const &)=delete
 
IFDv2Conditionoperator= (IFDv2Condition &&)=delete
 

Detailed Description

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.

Member Enumeration Documentation

◆ Type

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.

Member Function Documentation

◆ Close()

virtual void launchdarkly::server_side::data_interfaces::IFDv2Condition::Close ( )
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.

◆ Execute()

virtual async::Future<Type> launchdarkly::server_side::data_interfaces::IFDv2Condition::Execute ( )
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.

◆ GetType()

virtual Type launchdarkly::server_side::data_interfaces::IFDv2Condition::GetType ( ) const
pure virtual

◆ Inform()

virtual void launchdarkly::server_side::data_interfaces::IFDv2Condition::Inform ( FDv2SourceResult const &  result)
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.


The documentation for this class was generated from the following file: