launchdarkly-server-sdk 8.11.3-java → 8.12.0-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ldclient-rb/config.rb +25 -28
- data/lib/ldclient-rb/data_system.rb +22 -38
- data/lib/ldclient-rb/events.rb +1 -1
- data/lib/ldclient-rb/impl/data_source/requestor.rb +9 -2
- data/lib/ldclient-rb/impl/data_source/status_provider.rb +5 -0
- data/lib/ldclient-rb/impl/data_store/in_memory_feature_store.rb +1 -1
- data/lib/ldclient-rb/impl/data_store/status_provider.rb +0 -6
- data/lib/ldclient-rb/impl/data_store/store.rb +2 -2
- data/lib/ldclient-rb/impl/data_system/data_source_builder_common.rb +77 -0
- data/lib/ldclient-rb/impl/data_system/fdv2.rb +81 -80
- data/lib/ldclient-rb/impl/data_system/http_config_options.rb +32 -0
- data/lib/ldclient-rb/impl/data_system/polling.rb +59 -32
- data/lib/ldclient-rb/impl/data_system/protocolv2.rb +8 -8
- data/lib/ldclient-rb/impl/data_system/streaming.rb +401 -0
- data/lib/ldclient-rb/impl/event_sender.rb +11 -4
- data/lib/ldclient-rb/impl/integrations/file_data_source_v2.rb +460 -0
- data/lib/ldclient-rb/impl/integrations/test_data/test_data_source_v2.rb +4 -2
- data/lib/ldclient-rb/impl/store_data_set_sorter.rb +1 -1
- data/lib/ldclient-rb/impl/util.rb +13 -7
- data/lib/ldclient-rb/integrations/file_data.rb +67 -0
- data/lib/ldclient-rb/integrations/test_data_v2.rb +27 -21
- data/lib/ldclient-rb/interfaces/data_system.rb +46 -97
- data/lib/ldclient-rb/interfaces/feature_store.rb +2 -2
- data/lib/ldclient-rb/ldclient.rb +16 -6
- data/lib/ldclient-rb/version.rb +1 -1
- data/lib/ldclient-rb.rb +1 -0
- metadata +8 -4
|
@@ -9,11 +9,8 @@ module LaunchDarkly
|
|
|
9
9
|
# A mechanism for providing dynamically updatable feature flag state in a
|
|
10
10
|
# simplified form to an SDK client in test scenarios using the FDv2 protocol.
|
|
11
11
|
#
|
|
12
|
-
# This
|
|
13
|
-
#
|
|
14
|
-
#
|
|
15
|
-
# Do not use it.
|
|
16
|
-
# You have been warned.
|
|
12
|
+
# This class is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
13
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
17
14
|
#
|
|
18
15
|
# Unlike {LaunchDarkly::Integrations::FileData}, this mechanism does not use any external resources. It
|
|
19
16
|
# provides only the data that the application has put into it using the {#update} method.
|
|
@@ -32,7 +29,7 @@ module LaunchDarkly
|
|
|
32
29
|
#
|
|
33
30
|
# # config = LaunchDarkly::Config.new(
|
|
34
31
|
# # sdk_key,
|
|
35
|
-
# #
|
|
32
|
+
# # data_system_config: data_config.build
|
|
36
33
|
# # )
|
|
37
34
|
#
|
|
38
35
|
# # flags can be updated at any time:
|
|
@@ -117,12 +114,13 @@ module LaunchDarkly
|
|
|
117
114
|
instances_copy = []
|
|
118
115
|
new_flag = nil
|
|
119
116
|
@lock.with_write_lock do
|
|
120
|
-
|
|
117
|
+
flag_key = flag_builder._key.to_sym
|
|
118
|
+
old_flag = @current_flags[flag_key]
|
|
121
119
|
old_version = old_flag ? old_flag[:version] : 0
|
|
122
120
|
|
|
123
121
|
new_flag = flag_builder.build(old_version + 1)
|
|
124
122
|
|
|
125
|
-
@current_flags[
|
|
123
|
+
@current_flags[flag_key] = new_flag
|
|
126
124
|
@flag_builders[flag_builder._key] = flag_builder.clone
|
|
127
125
|
|
|
128
126
|
# Create a copy of instances while holding the lock to avoid race conditions
|
|
@@ -200,7 +198,7 @@ module LaunchDarkly
|
|
|
200
198
|
else
|
|
201
199
|
segment.as_json
|
|
202
200
|
end
|
|
203
|
-
segment_key = segment_hash[:key]
|
|
201
|
+
segment_key = segment_hash[:key].to_sym
|
|
204
202
|
|
|
205
203
|
old_segment = @current_segments[segment_key]
|
|
206
204
|
old_version = old_segment ? old_segment[:version] : 0
|
|
@@ -222,25 +220,33 @@ module LaunchDarkly
|
|
|
222
220
|
end
|
|
223
221
|
|
|
224
222
|
#
|
|
225
|
-
#
|
|
223
|
+
# Returns a builder for creating a data source that can be used with the FDv2 data system
|
|
224
|
+
# as either an initializer or synchronizer.
|
|
226
225
|
#
|
|
227
|
-
# @
|
|
228
|
-
# @param config [LaunchDarkly::Config] the SDK configuration
|
|
229
|
-
# @return [LaunchDarkly::Impl::Integrations::TestData::TestDataSourceV2] a test data initializer
|
|
226
|
+
# @return [TestDataV2Builder] a builder for a test data source
|
|
230
227
|
#
|
|
231
|
-
def
|
|
232
|
-
|
|
228
|
+
def test_data_ds_builder
|
|
229
|
+
TestDataV2Builder.new(self)
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
#
|
|
234
|
+
# Builder for TestDataV2 data sources (works for both initializers and synchronizers).
|
|
235
|
+
#
|
|
236
|
+
class TestDataV2Builder
|
|
237
|
+
def initialize(test_data)
|
|
238
|
+
@test_data = test_data
|
|
233
239
|
end
|
|
234
240
|
|
|
235
241
|
#
|
|
236
|
-
#
|
|
242
|
+
# Builds the data source.
|
|
237
243
|
#
|
|
238
|
-
# @param sdk_key [String] the SDK key
|
|
239
|
-
# @param config [LaunchDarkly::Config] the SDK configuration
|
|
240
|
-
# @return [LaunchDarkly::Impl::Integrations::TestData::TestDataSourceV2] a test data
|
|
244
|
+
# @param sdk_key [String] the SDK key (unused, for interface compatibility)
|
|
245
|
+
# @param config [LaunchDarkly::Config] the SDK configuration (unused, for interface compatibility)
|
|
246
|
+
# @return [LaunchDarkly::Impl::Integrations::TestData::TestDataSourceV2] a test data source
|
|
241
247
|
#
|
|
242
|
-
def
|
|
243
|
-
LaunchDarkly::Impl::Integrations::TestData::TestDataSourceV2.new(
|
|
248
|
+
def build(sdk_key, config)
|
|
249
|
+
LaunchDarkly::Impl::Integrations::TestData::TestDataSourceV2.new(@test_data)
|
|
244
250
|
end
|
|
245
251
|
end
|
|
246
252
|
end
|
|
@@ -6,43 +6,37 @@ module LaunchDarkly
|
|
|
6
6
|
#
|
|
7
7
|
# EventName represents the name of an event that can be sent by the server for FDv2.
|
|
8
8
|
#
|
|
9
|
-
# This type is not stable, and not subject to any backwards
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
# Do not use it.
|
|
13
|
-
# You have been warned.
|
|
9
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
10
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
14
11
|
#
|
|
15
12
|
module EventName
|
|
16
13
|
# Specifies that an object should be added to the data set with upsert semantics.
|
|
17
|
-
PUT_OBJECT = "put-object"
|
|
14
|
+
PUT_OBJECT = :"put-object"
|
|
18
15
|
|
|
19
16
|
# Specifies that an object should be removed from the data set.
|
|
20
|
-
DELETE_OBJECT = "delete-object"
|
|
17
|
+
DELETE_OBJECT = :"delete-object"
|
|
21
18
|
|
|
22
19
|
# Specifies the server's intent.
|
|
23
|
-
SERVER_INTENT = "server-intent"
|
|
20
|
+
SERVER_INTENT = :"server-intent"
|
|
24
21
|
|
|
25
22
|
# Specifies that all data required to bring the existing data set to a new version has been transferred.
|
|
26
|
-
PAYLOAD_TRANSFERRED = "payload-transferred"
|
|
23
|
+
PAYLOAD_TRANSFERRED = :"payload-transferred"
|
|
27
24
|
|
|
28
25
|
# Keeps the connection alive.
|
|
29
|
-
HEARTBEAT = "heart-beat"
|
|
26
|
+
HEARTBEAT = :"heart-beat"
|
|
30
27
|
|
|
31
28
|
# Specifies that the server is about to close the connection.
|
|
32
|
-
GOODBYE =
|
|
29
|
+
GOODBYE = :goodbye
|
|
33
30
|
|
|
34
31
|
# Specifies that an error occurred while serving the connection.
|
|
35
|
-
ERROR =
|
|
32
|
+
ERROR = :error
|
|
36
33
|
end
|
|
37
34
|
|
|
38
35
|
#
|
|
39
36
|
# ObjectKind represents the kind of object.
|
|
40
37
|
#
|
|
41
|
-
# This type is not stable, and not subject to any backwards
|
|
42
|
-
#
|
|
43
|
-
#
|
|
44
|
-
# Do not use it.
|
|
45
|
-
# You have been warned.
|
|
38
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
39
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
46
40
|
#
|
|
47
41
|
module ObjectKind
|
|
48
42
|
# Represents a feature flag.
|
|
@@ -55,11 +49,8 @@ module LaunchDarkly
|
|
|
55
49
|
#
|
|
56
50
|
# ChangeType specifies if an object is being upserted or deleted.
|
|
57
51
|
#
|
|
58
|
-
# This type is not stable, and not subject to any backwards
|
|
59
|
-
#
|
|
60
|
-
#
|
|
61
|
-
# Do not use it.
|
|
62
|
-
# You have been warned.
|
|
52
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
53
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
63
54
|
#
|
|
64
55
|
module ChangeType
|
|
65
56
|
# Represents an object being upserted.
|
|
@@ -72,11 +63,8 @@ module LaunchDarkly
|
|
|
72
63
|
#
|
|
73
64
|
# IntentCode represents the various intents that can be sent by the server.
|
|
74
65
|
#
|
|
75
|
-
# This type is not stable, and not subject to any backwards
|
|
76
|
-
#
|
|
77
|
-
#
|
|
78
|
-
# Do not use it.
|
|
79
|
-
# You have been warned.
|
|
66
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
67
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
80
68
|
#
|
|
81
69
|
module IntentCode
|
|
82
70
|
# The server intends to send a full data set.
|
|
@@ -92,11 +80,8 @@ module LaunchDarkly
|
|
|
92
80
|
#
|
|
93
81
|
# DataStoreMode represents the mode of operation of a Data Store in FDV2 mode.
|
|
94
82
|
#
|
|
95
|
-
# This type is not stable, and not subject to any backwards
|
|
96
|
-
#
|
|
97
|
-
#
|
|
98
|
-
# Do not use it.
|
|
99
|
-
# You have been warned.
|
|
83
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
84
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
100
85
|
#
|
|
101
86
|
module DataStoreMode
|
|
102
87
|
# Indicates that the data store is read-only. Data will never be written back to the store by the SDK.
|
|
@@ -110,11 +95,8 @@ module LaunchDarkly
|
|
|
110
95
|
#
|
|
111
96
|
# Selector represents a particular snapshot of data.
|
|
112
97
|
#
|
|
113
|
-
# This type is not stable, and not subject to any backwards
|
|
114
|
-
#
|
|
115
|
-
#
|
|
116
|
-
# Do not use it.
|
|
117
|
-
# You have been warned.
|
|
98
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
99
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
118
100
|
#
|
|
119
101
|
class Selector
|
|
120
102
|
# @return [String] The state
|
|
@@ -153,7 +135,7 @@ module LaunchDarkly
|
|
|
153
135
|
#
|
|
154
136
|
# Returns the event name for payload transfer.
|
|
155
137
|
#
|
|
156
|
-
# @return [
|
|
138
|
+
# @return [Symbol]
|
|
157
139
|
#
|
|
158
140
|
def name
|
|
159
141
|
EventName::PAYLOAD_TRANSFERRED
|
|
@@ -214,11 +196,8 @@ module LaunchDarkly
|
|
|
214
196
|
#
|
|
215
197
|
# Change represents a change to a piece of data, such as an update or deletion.
|
|
216
198
|
#
|
|
217
|
-
# This type is not stable, and not subject to any backwards
|
|
218
|
-
#
|
|
219
|
-
#
|
|
220
|
-
# Do not use it.
|
|
221
|
-
# You have been warned.
|
|
199
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
200
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
222
201
|
#
|
|
223
202
|
class Change
|
|
224
203
|
# @return [String] The action ({ChangeType})
|
|
@@ -227,7 +206,7 @@ module LaunchDarkly
|
|
|
227
206
|
# @return [String] The kind ({ObjectKind})
|
|
228
207
|
attr_reader :kind
|
|
229
208
|
|
|
230
|
-
# @return [
|
|
209
|
+
# @return [Symbol] The key
|
|
231
210
|
attr_reader :key
|
|
232
211
|
|
|
233
212
|
# @return [Integer] The version
|
|
@@ -239,7 +218,7 @@ module LaunchDarkly
|
|
|
239
218
|
#
|
|
240
219
|
# @param action [String] The action type ({ChangeType})
|
|
241
220
|
# @param kind [String] The object kind ({ObjectKind})
|
|
242
|
-
# @param key [
|
|
221
|
+
# @param key [Symbol] The key
|
|
243
222
|
# @param version [Integer] The version
|
|
244
223
|
# @param object [Hash, nil] The object data
|
|
245
224
|
#
|
|
@@ -255,11 +234,8 @@ module LaunchDarkly
|
|
|
255
234
|
#
|
|
256
235
|
# ChangeSet represents a list of changes to be applied.
|
|
257
236
|
#
|
|
258
|
-
# This type is not stable, and not subject to any backwards
|
|
259
|
-
#
|
|
260
|
-
#
|
|
261
|
-
# Do not use it.
|
|
262
|
-
# You have been warned.
|
|
237
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
238
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
263
239
|
#
|
|
264
240
|
class ChangeSet
|
|
265
241
|
# @return [String] The intent code ({IntentCode})
|
|
@@ -286,11 +262,8 @@ module LaunchDarkly
|
|
|
286
262
|
#
|
|
287
263
|
# Basis represents the initial payload of data that a data source can provide.
|
|
288
264
|
#
|
|
289
|
-
# This type is not stable, and not subject to any backwards
|
|
290
|
-
#
|
|
291
|
-
#
|
|
292
|
-
# Do not use it.
|
|
293
|
-
# You have been warned.
|
|
265
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
266
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
294
267
|
#
|
|
295
268
|
class Basis
|
|
296
269
|
# @return [ChangeSet] The change set
|
|
@@ -317,11 +290,8 @@ module LaunchDarkly
|
|
|
317
290
|
#
|
|
318
291
|
# Payload represents a payload delivered in a streaming response.
|
|
319
292
|
#
|
|
320
|
-
# This type is not stable, and not subject to any backwards
|
|
321
|
-
#
|
|
322
|
-
#
|
|
323
|
-
# Do not use it.
|
|
324
|
-
# You have been warned.
|
|
293
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
294
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
325
295
|
#
|
|
326
296
|
class Payload
|
|
327
297
|
# @return [String] The payload ID
|
|
@@ -387,11 +357,8 @@ module LaunchDarkly
|
|
|
387
357
|
#
|
|
388
358
|
# ServerIntent represents the type of change associated with the payload.
|
|
389
359
|
#
|
|
390
|
-
# This type is not stable, and not subject to any backwards
|
|
391
|
-
#
|
|
392
|
-
#
|
|
393
|
-
# Do not use it.
|
|
394
|
-
# You have been warned.
|
|
360
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
361
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
395
362
|
#
|
|
396
363
|
class ServerIntent
|
|
397
364
|
# @return [Payload] The payload
|
|
@@ -438,11 +405,8 @@ module LaunchDarkly
|
|
|
438
405
|
#
|
|
439
406
|
# ChangeSetBuilder is a helper for constructing a ChangeSet.
|
|
440
407
|
#
|
|
441
|
-
# This type is not stable, and not subject to any backwards
|
|
442
|
-
#
|
|
443
|
-
#
|
|
444
|
-
# Do not use it.
|
|
445
|
-
# You have been warned.
|
|
408
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
409
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
446
410
|
#
|
|
447
411
|
class ChangeSetBuilder
|
|
448
412
|
# @return [String, nil] The current intent ({IntentCode})
|
|
@@ -546,7 +510,7 @@ module LaunchDarkly
|
|
|
546
510
|
# Adds a new object to the changeset.
|
|
547
511
|
#
|
|
548
512
|
# @param kind [String] The object kind ({ObjectKind})
|
|
549
|
-
# @param key [
|
|
513
|
+
# @param key [Symbol] The key
|
|
550
514
|
# @param version [Integer] The version
|
|
551
515
|
# @param obj [Hash] The object data
|
|
552
516
|
# @return [void]
|
|
@@ -565,7 +529,7 @@ module LaunchDarkly
|
|
|
565
529
|
# Adds a deletion to the changeset.
|
|
566
530
|
#
|
|
567
531
|
# @param kind [String] The object kind ({ObjectKind})
|
|
568
|
-
# @param key [
|
|
532
|
+
# @param key [Symbol] The key
|
|
569
533
|
# @param version [Integer] The version
|
|
570
534
|
# @return [void]
|
|
571
535
|
#
|
|
@@ -582,11 +546,8 @@ module LaunchDarkly
|
|
|
582
546
|
#
|
|
583
547
|
# Update represents the results of a synchronizer's ongoing sync method.
|
|
584
548
|
#
|
|
585
|
-
# This type is not stable, and not subject to any backwards
|
|
586
|
-
#
|
|
587
|
-
#
|
|
588
|
-
# Do not use it.
|
|
589
|
-
# You have been warned.
|
|
549
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
550
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
590
551
|
#
|
|
591
552
|
class Update
|
|
592
553
|
# @return [Symbol] The data source state ({LaunchDarkly::Interfaces::DataSource::Status})
|
|
@@ -623,11 +584,8 @@ module LaunchDarkly
|
|
|
623
584
|
#
|
|
624
585
|
# SelectorStore represents a component capable of providing Selectors for data retrieval.
|
|
625
586
|
#
|
|
626
|
-
# This type is not stable, and not subject to any backwards
|
|
627
|
-
#
|
|
628
|
-
#
|
|
629
|
-
# Do not use it.
|
|
630
|
-
# You have been warned.
|
|
587
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
588
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
631
589
|
#
|
|
632
590
|
module SelectorStore
|
|
633
591
|
#
|
|
@@ -643,11 +601,8 @@ module LaunchDarkly
|
|
|
643
601
|
#
|
|
644
602
|
# ReadOnlyStore represents a read-only store interface for retrieving data.
|
|
645
603
|
#
|
|
646
|
-
# This type is not stable, and not subject to any backwards
|
|
647
|
-
#
|
|
648
|
-
#
|
|
649
|
-
# Do not use it.
|
|
650
|
-
# You have been warned.
|
|
604
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
605
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
651
606
|
#
|
|
652
607
|
module ReadOnlyStore
|
|
653
608
|
#
|
|
@@ -684,11 +639,8 @@ module LaunchDarkly
|
|
|
684
639
|
#
|
|
685
640
|
# Initializer represents a component capable of retrieving a single data result.
|
|
686
641
|
#
|
|
687
|
-
# This type is not stable, and not subject to any backwards
|
|
688
|
-
#
|
|
689
|
-
#
|
|
690
|
-
# Do not use it.
|
|
691
|
-
# You have been warned.
|
|
642
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
643
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
692
644
|
#
|
|
693
645
|
module Initializer
|
|
694
646
|
#
|
|
@@ -714,11 +666,8 @@ module LaunchDarkly
|
|
|
714
666
|
#
|
|
715
667
|
# Synchronizer represents a component capable of synchronizing data from an external source.
|
|
716
668
|
#
|
|
717
|
-
# This type is not stable, and not subject to any backwards
|
|
718
|
-
#
|
|
719
|
-
#
|
|
720
|
-
# Do not use it.
|
|
721
|
-
# You have been warned.
|
|
669
|
+
# This type is not stable, and not subject to any backwards compatibility guarantees or semantic versioning.
|
|
670
|
+
# It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
|
|
722
671
|
#
|
|
723
672
|
module Synchronizer
|
|
724
673
|
#
|
|
@@ -36,7 +36,7 @@ module LaunchDarkly
|
|
|
36
36
|
# the correct order), storing each item, and then delete any leftover items at the very end.
|
|
37
37
|
#
|
|
38
38
|
# @param all_data [Hash] a hash where each key is one of the data kind objects, and each
|
|
39
|
-
# value is in turn a hash of
|
|
39
|
+
# value is in turn a hash of symbol keys to entities
|
|
40
40
|
# @return [void]
|
|
41
41
|
#
|
|
42
42
|
def init(all_data)
|
|
@@ -46,7 +46,7 @@ module LaunchDarkly
|
|
|
46
46
|
# Returns the entity to which the specified key is mapped, if any.
|
|
47
47
|
#
|
|
48
48
|
# @param kind [Object] the kind of entity to get
|
|
49
|
-
# @param key [String] the unique key of the entity to get
|
|
49
|
+
# @param key [String, Symbol] the unique key of the entity to get
|
|
50
50
|
# @return [Hash] the entity; nil if the key was not found, or if the stored entity's
|
|
51
51
|
# `:deleted` property was true
|
|
52
52
|
#
|
data/lib/ldclient-rb/ldclient.rb
CHANGED
|
@@ -4,6 +4,7 @@ require "ldclient-rb/impl/context"
|
|
|
4
4
|
require "ldclient-rb/impl/data_source"
|
|
5
5
|
require "ldclient-rb/impl/data_store"
|
|
6
6
|
require "ldclient-rb/impl/data_system/fdv1"
|
|
7
|
+
require "ldclient-rb/impl/data_system/fdv2"
|
|
7
8
|
require "ldclient-rb/impl/diagnostic_events"
|
|
8
9
|
require "ldclient-rb/impl/evaluation_with_hook_result"
|
|
9
10
|
require "ldclient-rb/impl/evaluator"
|
|
@@ -113,9 +114,16 @@ module LaunchDarkly
|
|
|
113
114
|
|
|
114
115
|
@hooks = Concurrent::Array.new(@config.hooks + plugin_hooks)
|
|
115
116
|
|
|
116
|
-
# Initialize the data system
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
# Initialize the data system - use FDv2 if configured, otherwise FDv1
|
|
118
|
+
data_system_config = @config.data_system_config
|
|
119
|
+
if data_system_config.nil?
|
|
120
|
+
# Use FDv1 for backwards compatibility
|
|
121
|
+
# Note: FDv1 will update @config.feature_store to use its wrapped store
|
|
122
|
+
@data_system = Impl::DataSystem::FDv1.new(@sdk_key, @config)
|
|
123
|
+
else
|
|
124
|
+
# Use FDv2 with the provided configuration
|
|
125
|
+
@data_system = Impl::DataSystem::FDv2.new(@sdk_key, @config, data_system_config)
|
|
126
|
+
end
|
|
119
127
|
|
|
120
128
|
# Components not managed by data system
|
|
121
129
|
@big_segment_store_manager = Impl::BigSegmentStoreManager.new(@config.big_segments, @config.logger)
|
|
@@ -256,7 +264,9 @@ module LaunchDarkly
|
|
|
256
264
|
# @return [Boolean] true if the client has been initialized
|
|
257
265
|
#
|
|
258
266
|
def initialized?
|
|
259
|
-
@
|
|
267
|
+
return true if @config.offline? || @config.use_ldd?
|
|
268
|
+
|
|
269
|
+
Impl::DataSystem::DataAvailability.at_least?(@data_system.data_availability, Impl::DataSystem::DataAvailability::CACHED)
|
|
260
270
|
end
|
|
261
271
|
|
|
262
272
|
#
|
|
@@ -684,8 +694,8 @@ module LaunchDarkly
|
|
|
684
694
|
return detail, nil, context.error
|
|
685
695
|
end
|
|
686
696
|
|
|
687
|
-
|
|
688
|
-
if @data_system.
|
|
697
|
+
if @data_system.data_availability != Impl::DataSystem::DataAvailability::REFRESHED
|
|
698
|
+
if @data_system.data_availability == Impl::DataSystem::DataAvailability::CACHED
|
|
689
699
|
@config.logger.warn { "[LDClient] Client has not finished initializing; using last known values from feature store" }
|
|
690
700
|
else
|
|
691
701
|
@config.logger.error { "[LDClient] Client has not finished initializing; feature store unavailable, returning default value" }
|
data/lib/ldclient-rb/version.rb
CHANGED
data/lib/ldclient-rb.rb
CHANGED
|
@@ -8,6 +8,7 @@ end
|
|
|
8
8
|
# Public APIs - these define the main interfaces users interact with
|
|
9
9
|
require "ldclient-rb/config"
|
|
10
10
|
require "ldclient-rb/context"
|
|
11
|
+
require "ldclient-rb/data_system"
|
|
11
12
|
require "ldclient-rb/flags_state"
|
|
12
13
|
require "ldclient-rb/integrations"
|
|
13
14
|
require "ldclient-rb/interfaces"
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: launchdarkly-server-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.
|
|
4
|
+
version: 8.12.0
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- LaunchDarkly
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-01-
|
|
10
|
+
date: 2026-01-30 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: aws-sdk-dynamodb
|
|
@@ -271,14 +271,14 @@ dependencies:
|
|
|
271
271
|
requirements:
|
|
272
272
|
- - '='
|
|
273
273
|
- !ruby/object:Gem::Version
|
|
274
|
-
version: 2.
|
|
274
|
+
version: 2.5.0
|
|
275
275
|
type: :runtime
|
|
276
276
|
prerelease: false
|
|
277
277
|
version_requirements: !ruby/object:Gem::Requirement
|
|
278
278
|
requirements:
|
|
279
279
|
- - '='
|
|
280
280
|
- !ruby/object:Gem::Version
|
|
281
|
-
version: 2.
|
|
281
|
+
version: 2.5.0
|
|
282
282
|
- !ruby/object:Gem::Dependency
|
|
283
283
|
name: observer
|
|
284
284
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -397,10 +397,13 @@ files:
|
|
|
397
397
|
- lib/ldclient-rb/impl/data_store/status_provider.rb
|
|
398
398
|
- lib/ldclient-rb/impl/data_store/store.rb
|
|
399
399
|
- lib/ldclient-rb/impl/data_system.rb
|
|
400
|
+
- lib/ldclient-rb/impl/data_system/data_source_builder_common.rb
|
|
400
401
|
- lib/ldclient-rb/impl/data_system/fdv1.rb
|
|
401
402
|
- lib/ldclient-rb/impl/data_system/fdv2.rb
|
|
403
|
+
- lib/ldclient-rb/impl/data_system/http_config_options.rb
|
|
402
404
|
- lib/ldclient-rb/impl/data_system/polling.rb
|
|
403
405
|
- lib/ldclient-rb/impl/data_system/protocolv2.rb
|
|
406
|
+
- lib/ldclient-rb/impl/data_system/streaming.rb
|
|
404
407
|
- lib/ldclient-rb/impl/dependency_tracker.rb
|
|
405
408
|
- lib/ldclient-rb/impl/diagnostic_events.rb
|
|
406
409
|
- lib/ldclient-rb/impl/evaluation_with_hook_result.rb
|
|
@@ -416,6 +419,7 @@ files:
|
|
|
416
419
|
- lib/ldclient-rb/impl/integrations/consul_impl.rb
|
|
417
420
|
- lib/ldclient-rb/impl/integrations/dynamodb_impl.rb
|
|
418
421
|
- lib/ldclient-rb/impl/integrations/file_data_source.rb
|
|
422
|
+
- lib/ldclient-rb/impl/integrations/file_data_source_v2.rb
|
|
419
423
|
- lib/ldclient-rb/impl/integrations/redis_impl.rb
|
|
420
424
|
- lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb
|
|
421
425
|
- lib/ldclient-rb/impl/integrations/test_data/test_data_source_v2.rb
|