|
C++ Server-Side SDK
LaunchDarkly SDK
|
#include <evaluation_stack.hpp>
Public Member Functions | |
| EvaluationStack (data_components::BigSegmentStoreWrapper *big_segment_store=nullptr) | |
| std::optional< Guard > | NoticePrerequisite (std::string prerequisite_key) |
| std::optional< Guard > | NoticeSegment (std::string segment_key) |
| data_components::BigSegmentStoreWrapper * | BigSegmentStore () const |
| void | RecordBigSegmentsStatus (enum EvaluationReason::BigSegmentsStatus status) |
| enum EvaluationReason::BigSegmentsStatus | BigSegmentsStatus () const |
| integrations::Membership const * | FindMembership (std::string const &context_key) const |
| void | StoreMembership (std::string context_key, integrations::Membership membership) |
| void | RecordStoreError (std::string context_key) |
| bool | DidStoreError (std::string const &context_key) const |
EvaluationStack holds the per-evaluation state for a single top-level flag evaluation: the prerequisite/segment chains used for circular-reference detection, plus the Big Segments status and membership cache that a Big Segment lookup populates.
Not thread-safe: a fresh instance is created per top-level evaluation and is never shared across threads.
|
explicit |
| big_segment_store | Non-owning pointer to the Big Segment store wrapper, or nullptr if no store is configured. Must outlive the stack. |
| enum EvaluationReason::BigSegmentsStatus launchdarkly::server_side::evaluation::EvaluationStack::BigSegmentsStatus | ( | ) | const |
| data_components::BigSegmentStoreWrapper * launchdarkly::server_side::evaluation::EvaluationStack::BigSegmentStore | ( | ) | const |
| bool launchdarkly::server_side::evaluation::EvaluationStack::DidStoreError | ( | std::string const & | context_key | ) | const |
| integrations::Membership const * launchdarkly::server_side::evaluation::EvaluationStack::FindMembership | ( | std::string const & | context_key | ) | const |
Returns the cached membership for a context key looked up earlier in this evaluation, or nullptr if that key has not been queried yet.
| std::optional< Guard > launchdarkly::server_side::evaluation::EvaluationStack::NoticePrerequisite | ( | std::string | prerequisite_key | ) |
| std::optional< Guard > launchdarkly::server_side::evaluation::EvaluationStack::NoticeSegment | ( | std::string | segment_key | ) |
| void launchdarkly::server_side::evaluation::EvaluationStack::RecordBigSegmentsStatus | ( | enum EvaluationReason::BigSegmentsStatus | status | ) |
Records the status of a Big Segment lookup. If multiple lookups occur in one evaluation, the least-trustworthy status wins (NOT_CONFIGURED > STORE_ERROR > STALE > HEALTHY).
| void launchdarkly::server_side::evaluation::EvaluationStack::RecordStoreError | ( | std::string | context_key | ) |
Records that the Big Segment store returned an error for the given context key during this evaluation. Subsequent Big Segment lookups for the same key must be treated as non-matches without re-querying.
| void launchdarkly::server_side::evaluation::EvaluationStack::StoreMembership | ( | std::string | context_key, |
| integrations::Membership | membership | ||
| ) |
Caches a context key's membership so later Big Segment lookups for the same key in this evaluation reuse it instead of re-querying the store.