21 using TimeStampsource =
22 std::function<std::chrono::time_point<std::chrono::system_clock>()>;
25 std::string
const& sdk_key,
28 std::shared_ptr<IPersistence> persistence,
30 std::size_t max_cached_contexts,
31 TimeStampsource time_stamper = []() {
32 return std::chrono::system_clock::now();
35 void Init(
Context const& context,
36 std::unordered_map<std::string, ItemDescriptor> data)
override;
38 void Upsert(
Context const& context,
40 ItemDescriptor item)
override;
42 void LoadCached(
Context const& context);
45 inline static std::string global_namespace_ =
"LaunchDarkly";
46 inline static std::string index_key_ =
"ContextIndex";
49 std::size_t max_cached_contexts_;
52 std::shared_ptr<IPersistence> persistence_;
53 mutable std::recursive_mutex persistence_mutex_;
56 std::string environment_namespace_;
57 TimeStampsource time_stamper_;
60 void StoreCache(std::string
const& context_id);
Definition context.hpp:29
Definition context_index.hpp:24