launchdarkly-server-sdk 8.13.0-java → 8.14.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/README.md +1 -1
- data/lib/ldclient-rb/config.rb +0 -3
- data/lib/ldclient-rb/data_system/polling_data_source_builder.rb +7 -5
- data/lib/ldclient-rb/impl/data_store/feature_store_client_wrapper.rb +12 -0
- data/lib/ldclient-rb/impl/data_store/store.rb +24 -0
- data/lib/ldclient-rb/impl/data_system/fdv2.rb +67 -12
- data/lib/ldclient-rb/impl/data_system/polling.rb +99 -32
- data/lib/ldclient-rb/impl/data_system/protocolv2.rb +3 -29
- data/lib/ldclient-rb/impl/data_system/streaming.rb +54 -31
- data/lib/ldclient-rb/impl/data_system.rb +6 -5
- data/lib/ldclient-rb/impl/integrations/file_data_source_v2.rb +29 -22
- data/lib/ldclient-rb/impl/integrations/redis_impl.rb +4 -0
- data/lib/ldclient-rb/impl/integrations/test_data/test_data_source_v2.rb +53 -48
- data/lib/ldclient-rb/integrations/consul.rb +6 -2
- data/lib/ldclient-rb/integrations/dynamodb.rb +6 -2
- data/lib/ldclient-rb/integrations/file_data.rb +0 -3
- data/lib/ldclient-rb/integrations/redis.rb +6 -2
- data/lib/ldclient-rb/integrations/test_data_v2.rb +0 -3
- data/lib/ldclient-rb/integrations/util/store_wrapper.rb +39 -19
- data/lib/ldclient-rb/interfaces/data_system.rb +60 -57
- data/lib/ldclient-rb/util.rb +3 -2
- data/lib/ldclient-rb/version.rb +1 -1
- metadata +2 -2
|
@@ -6,9 +6,6 @@ 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 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
|
|
11
|
-
#
|
|
12
9
|
module EventName
|
|
13
10
|
# Specifies that an object should be added to the data set with upsert semantics.
|
|
14
11
|
PUT_OBJECT = :"put-object"
|
|
@@ -35,9 +32,6 @@ module LaunchDarkly
|
|
|
35
32
|
#
|
|
36
33
|
# ObjectKind represents the kind of object.
|
|
37
34
|
#
|
|
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
|
|
40
|
-
#
|
|
41
35
|
module ObjectKind
|
|
42
36
|
# Represents a feature flag.
|
|
43
37
|
FLAG = "flag"
|
|
@@ -49,9 +43,6 @@ module LaunchDarkly
|
|
|
49
43
|
#
|
|
50
44
|
# ChangeType specifies if an object is being upserted or deleted.
|
|
51
45
|
#
|
|
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
|
|
54
|
-
#
|
|
55
46
|
module ChangeType
|
|
56
47
|
# Represents an object being upserted.
|
|
57
48
|
PUT = "put"
|
|
@@ -63,9 +54,6 @@ module LaunchDarkly
|
|
|
63
54
|
#
|
|
64
55
|
# IntentCode represents the various intents that can be sent by the server.
|
|
65
56
|
#
|
|
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
|
|
68
|
-
#
|
|
69
57
|
module IntentCode
|
|
70
58
|
# The server intends to send a full data set.
|
|
71
59
|
TRANSFER_FULL = "xfer-full"
|
|
@@ -80,9 +68,6 @@ module LaunchDarkly
|
|
|
80
68
|
#
|
|
81
69
|
# DataStoreMode represents the mode of operation of a Data Store in FDV2 mode.
|
|
82
70
|
#
|
|
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
|
|
85
|
-
#
|
|
86
71
|
module DataStoreMode
|
|
87
72
|
# Indicates that the data store is read-only. Data will never be written back to the store by the SDK.
|
|
88
73
|
READ_ONLY = :read_only
|
|
@@ -95,9 +80,6 @@ module LaunchDarkly
|
|
|
95
80
|
#
|
|
96
81
|
# Selector represents a particular snapshot of data.
|
|
97
82
|
#
|
|
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
|
|
100
|
-
#
|
|
101
83
|
class Selector
|
|
102
84
|
# @return [String] The state
|
|
103
85
|
attr_reader :state
|
|
@@ -196,9 +178,6 @@ module LaunchDarkly
|
|
|
196
178
|
#
|
|
197
179
|
# Change represents a change to a piece of data, such as an update or deletion.
|
|
198
180
|
#
|
|
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
|
|
201
|
-
#
|
|
202
181
|
class Change
|
|
203
182
|
# @return [String] The action ({ChangeType})
|
|
204
183
|
attr_reader :action
|
|
@@ -234,9 +213,6 @@ module LaunchDarkly
|
|
|
234
213
|
#
|
|
235
214
|
# ChangeSet represents a list of changes to be applied.
|
|
236
215
|
#
|
|
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
|
|
239
|
-
#
|
|
240
216
|
class ChangeSet
|
|
241
217
|
# @return [String] The intent code ({IntentCode})
|
|
242
218
|
attr_reader :intent_code
|
|
@@ -262,9 +238,6 @@ module LaunchDarkly
|
|
|
262
238
|
#
|
|
263
239
|
# Basis represents the initial payload of data that a data source can provide.
|
|
264
240
|
#
|
|
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
|
|
267
|
-
#
|
|
268
241
|
class Basis
|
|
269
242
|
# @return [ChangeSet] The change set
|
|
270
243
|
attr_reader :change_set
|
|
@@ -290,9 +263,6 @@ module LaunchDarkly
|
|
|
290
263
|
#
|
|
291
264
|
# Payload represents a payload delivered in a streaming response.
|
|
292
265
|
#
|
|
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
|
|
295
|
-
#
|
|
296
266
|
class Payload
|
|
297
267
|
# @return [String] The payload ID
|
|
298
268
|
attr_reader :id
|
|
@@ -357,9 +327,6 @@ module LaunchDarkly
|
|
|
357
327
|
#
|
|
358
328
|
# ServerIntent represents the type of change associated with the payload.
|
|
359
329
|
#
|
|
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
|
|
362
|
-
#
|
|
363
330
|
class ServerIntent
|
|
364
331
|
# @return [Payload] The payload
|
|
365
332
|
attr_reader :payload
|
|
@@ -405,9 +372,6 @@ module LaunchDarkly
|
|
|
405
372
|
#
|
|
406
373
|
# ChangeSetBuilder is a helper for constructing a ChangeSet.
|
|
407
374
|
#
|
|
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
|
|
410
|
-
#
|
|
411
375
|
class ChangeSetBuilder
|
|
412
376
|
# @return [String, nil] The current intent ({IntentCode})
|
|
413
377
|
attr_accessor :intent
|
|
@@ -546,9 +510,6 @@ module LaunchDarkly
|
|
|
546
510
|
#
|
|
547
511
|
# Update represents the results of a synchronizer's ongoing sync method.
|
|
548
512
|
#
|
|
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
|
|
551
|
-
#
|
|
552
513
|
class Update
|
|
553
514
|
# @return [Symbol] The data source state ({LaunchDarkly::Interfaces::DataSource::Status})
|
|
554
515
|
attr_reader :state
|
|
@@ -559,8 +520,9 @@ module LaunchDarkly
|
|
|
559
520
|
# @return [LaunchDarkly::Interfaces::DataSource::ErrorInfo, nil] Error information
|
|
560
521
|
attr_reader :error
|
|
561
522
|
|
|
562
|
-
# @return [Boolean] Whether
|
|
563
|
-
|
|
523
|
+
# @return [Boolean] Whether the LaunchDarkly server has instructed the SDK to fall
|
|
524
|
+
# back to the FDv1 protocol (signalled via the `X-LD-FD-Fallback` response header).
|
|
525
|
+
attr_reader :fallback_to_fdv1
|
|
564
526
|
|
|
565
527
|
# @return [String, nil] The environment ID
|
|
566
528
|
attr_reader :environment_id
|
|
@@ -569,23 +531,67 @@ module LaunchDarkly
|
|
|
569
531
|
# @param state [Symbol] The data source state ({LaunchDarkly::Interfaces::DataSource::Status})
|
|
570
532
|
# @param change_set [ChangeSet, nil] The change set
|
|
571
533
|
# @param error [LaunchDarkly::Interfaces::DataSource::ErrorInfo, nil] Error information
|
|
572
|
-
# @param
|
|
534
|
+
# @param fallback_to_fdv1 [Boolean] Whether to fall back to FDv1
|
|
573
535
|
# @param environment_id [String, nil] The environment ID
|
|
574
536
|
#
|
|
575
|
-
def initialize(state:, change_set: nil, error: nil,
|
|
537
|
+
def initialize(state:, change_set: nil, error: nil, fallback_to_fdv1: false, environment_id: nil)
|
|
576
538
|
@state = state
|
|
577
539
|
@change_set = change_set
|
|
578
540
|
@error = error
|
|
579
|
-
@
|
|
541
|
+
@fallback_to_fdv1 = fallback_to_fdv1
|
|
580
542
|
@environment_id = environment_id
|
|
581
543
|
end
|
|
582
544
|
end
|
|
583
545
|
|
|
584
546
|
#
|
|
585
|
-
#
|
|
547
|
+
# FetchResult pairs the result of an {Initializer#fetch} call with the
|
|
548
|
+
# server-directed FDv1 Fallback Directive signal.
|
|
549
|
+
#
|
|
550
|
+
# When the LaunchDarkly server returns the `X-LD-FD-Fallback: true`
|
|
551
|
+
# response header on an initializer response, the SDK must apply any
|
|
552
|
+
# accompanying payload and then switch to the FDv1 Fallback Synchronizer.
|
|
553
|
+
# Surfacing this signal alongside the {LaunchDarkly::Result} ensures
|
|
554
|
+
# callers cannot silently drop it.
|
|
555
|
+
#
|
|
556
|
+
class FetchResult
|
|
557
|
+
# @return [LaunchDarkly::Result] A Result containing either a {Basis} or an error.
|
|
558
|
+
attr_reader :result
|
|
559
|
+
|
|
560
|
+
# @return [Boolean] Whether the server has instructed the SDK to fall back to the FDv1 protocol.
|
|
561
|
+
attr_reader :fallback_to_fdv1
|
|
562
|
+
|
|
563
|
+
#
|
|
564
|
+
# @param result [LaunchDarkly::Result] A Result containing either a Basis or an error.
|
|
565
|
+
# @param fallback_to_fdv1 [Boolean] Whether to fall back to FDv1.
|
|
566
|
+
#
|
|
567
|
+
def initialize(result:, fallback_to_fdv1: false)
|
|
568
|
+
@result = result
|
|
569
|
+
@fallback_to_fdv1 = fallback_to_fdv1
|
|
570
|
+
end
|
|
571
|
+
|
|
572
|
+
# @return [Boolean] true when the underlying Result was successful.
|
|
573
|
+
def success?
|
|
574
|
+
@result.success?
|
|
575
|
+
end
|
|
576
|
+
|
|
577
|
+
# @return [Object, nil] The {Basis} returned from a successful fetch, or nil.
|
|
578
|
+
def value
|
|
579
|
+
@result.value
|
|
580
|
+
end
|
|
581
|
+
|
|
582
|
+
# @return [String, nil] An error description, or nil on success.
|
|
583
|
+
def error
|
|
584
|
+
@result.error
|
|
585
|
+
end
|
|
586
|
+
|
|
587
|
+
# @return [Exception, nil] An optional exception describing the failure.
|
|
588
|
+
def exception
|
|
589
|
+
@result.exception
|
|
590
|
+
end
|
|
591
|
+
end
|
|
592
|
+
|
|
586
593
|
#
|
|
587
|
-
#
|
|
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
|
|
594
|
+
# SelectorStore represents a component capable of providing Selectors for data retrieval.
|
|
589
595
|
#
|
|
590
596
|
module SelectorStore
|
|
591
597
|
#
|
|
@@ -601,9 +607,6 @@ module LaunchDarkly
|
|
|
601
607
|
#
|
|
602
608
|
# ReadOnlyStore represents a read-only store interface for retrieving data.
|
|
603
609
|
#
|
|
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
|
|
606
|
-
#
|
|
607
610
|
module ReadOnlyStore
|
|
608
611
|
#
|
|
609
612
|
# Retrieves an item by kind and key.
|
|
@@ -639,9 +642,6 @@ module LaunchDarkly
|
|
|
639
642
|
#
|
|
640
643
|
# Initializer represents a component capable of retrieving a single data result.
|
|
641
644
|
#
|
|
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
|
|
644
|
-
#
|
|
645
645
|
module Initializer
|
|
646
646
|
#
|
|
647
647
|
# Returns the name of the initializer.
|
|
@@ -655,8 +655,14 @@ module LaunchDarkly
|
|
|
655
655
|
#
|
|
656
656
|
# Retrieves the initial data set for the data source.
|
|
657
657
|
#
|
|
658
|
+
# If the LaunchDarkly server has instructed the SDK to fall back to
|
|
659
|
+
# the FDv1 protocol, the returned {FetchResult#fallback_to_fdv1} is
|
|
660
|
+
# true. The wrapped result may still carry a successful {Basis} when
|
|
661
|
+
# the directive accompanied a valid payload, in which case callers
|
|
662
|
+
# should apply the payload before switching protocols.
|
|
663
|
+
#
|
|
658
664
|
# @param selector_store [SelectorStore] Provides the Selector
|
|
659
|
-
# @return [
|
|
665
|
+
# @return [FetchResult]
|
|
660
666
|
#
|
|
661
667
|
def fetch(selector_store)
|
|
662
668
|
raise NotImplementedError, "#{self.class} must implement #fetch"
|
|
@@ -666,9 +672,6 @@ module LaunchDarkly
|
|
|
666
672
|
#
|
|
667
673
|
# Synchronizer represents a component capable of synchronizing data from an external source.
|
|
668
674
|
#
|
|
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
|
|
671
|
-
#
|
|
672
675
|
module Synchronizer
|
|
673
676
|
#
|
|
674
677
|
# Returns the name of the synchronizer.
|
data/lib/ldclient-rb/util.rb
CHANGED
|
@@ -16,10 +16,11 @@ module LaunchDarkly
|
|
|
16
16
|
# Create a successful result with the provided value.
|
|
17
17
|
#
|
|
18
18
|
# @param value [Object, nil]
|
|
19
|
+
# @param headers [Hash, nil] Optional headers associated with the result
|
|
19
20
|
# @return [Result]
|
|
20
21
|
#
|
|
21
|
-
def self.success(value)
|
|
22
|
-
Result.new(value)
|
|
22
|
+
def self.success(value, headers = nil)
|
|
23
|
+
Result.new(value, nil, nil, headers)
|
|
23
24
|
end
|
|
24
25
|
|
|
25
26
|
#
|
data/lib/ldclient-rb/version.rb
CHANGED
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.14.0
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- LaunchDarkly
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-06-01 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: aws-sdk-dynamodb
|