launchdarkly-server-sdk 8.16.0-java → 8.18.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 +3 -0
- data/lib/ldclient-rb/impl/data_system/fdv2.rb +5 -0
- data/lib/ldclient-rb/impl/repeating_task.rb +26 -5
- data/lib/ldclient-rb/integrations/test_data/flag_builder.rb +1 -1
- data/lib/ldclient-rb/ldclient.rb +10 -2
- data/lib/ldclient-rb/version.rb +1 -1
- metadata +10 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b4f54af862047f472205f2c74c5ddcd68307cf16ad7a670a00936657f4904aba
|
|
4
|
+
data.tar.gz: 1f3da02fe1782c8bead177dbc7b9dfcd5a432df508f6e3f0b834708883a651e9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cef3a3c3ac786a60563ad0a580b1ed93bf404a3d92c32b0a5c9812f8ba69d8298a6fd6fc69c0005a5d7c1f0c5338855483966e7b05e2b9fbf1ac949d0d648035
|
|
7
|
+
data.tar.gz: 0fce5e4c5eb2928b44aecdb2e449a8dbb217dadb783ec1b9e2aa40bdfd82ba499079a4155160bb1b5434bb809ba7050f8e33f4c2d123ec484384cf0006e8c6e6
|
data/lib/ldclient-rb/config.rb
CHANGED
|
@@ -362,6 +362,9 @@ module LaunchDarkly
|
|
|
362
362
|
# This payload filter key only applies to the default streaming and polling data sources. It will not affect TestData or FileData
|
|
363
363
|
# data sources, nor will it be applied to any data source provided through the {#data_source} config property.
|
|
364
364
|
#
|
|
365
|
+
# Payload filtering is not supported with the FDv2 data system, so this key has no effect on requests made by FDv2
|
|
366
|
+
# data sources.
|
|
367
|
+
#
|
|
365
368
|
attr_reader :payload_filter_key
|
|
366
369
|
|
|
367
370
|
#
|
|
@@ -54,6 +54,11 @@ module LaunchDarkly
|
|
|
54
54
|
@config = config
|
|
55
55
|
@data_system_config = data_system_config
|
|
56
56
|
@logger = config.logger
|
|
57
|
+
|
|
58
|
+
unless config.payload_filter_key.nil?
|
|
59
|
+
@logger.warn { "[LDClient] Payload filtering is not supported with the FDv2 data system; the configured payload filter has no effect on FDv2 requests" }
|
|
60
|
+
end
|
|
61
|
+
|
|
57
62
|
@synchronizer_builders = data_system_config.synchronizers || []
|
|
58
63
|
@fdv1_fallback_synchronizer_builder = data_system_config.fdv1_fallback_synchronizer
|
|
59
64
|
@disabled = @config.offline?
|
|
@@ -4,22 +4,39 @@ require "concurrent/atomics"
|
|
|
4
4
|
|
|
5
5
|
module LaunchDarkly
|
|
6
6
|
module Impl
|
|
7
|
+
#
|
|
8
|
+
# Runs a task again and again on a worker thread, with a fixed interval
|
|
9
|
+
# between runs.
|
|
10
|
+
#
|
|
11
|
+
# The worker waits on an event instead of calling `sleep`, so `stop` can
|
|
12
|
+
# wake it at once even if `stop` runs before the worker starts waiting.
|
|
13
|
+
#
|
|
14
|
+
# @private
|
|
15
|
+
#
|
|
7
16
|
class RepeatingTask
|
|
8
17
|
attr_reader :name
|
|
9
18
|
|
|
19
|
+
#
|
|
20
|
+
# @param interval [Numeric] seconds between the start of one run and the start of the next
|
|
21
|
+
# @param start_delay [Numeric, nil] seconds to wait before the first run
|
|
22
|
+
# @param task [Proc] the code to run
|
|
23
|
+
# @param logger [Logger]
|
|
24
|
+
# @param name [String] the name given to the worker thread
|
|
25
|
+
#
|
|
10
26
|
def initialize(interval, start_delay, task, logger, name)
|
|
11
27
|
@interval = interval
|
|
12
28
|
@start_delay = start_delay
|
|
13
29
|
@task = task
|
|
14
30
|
@logger = logger
|
|
15
31
|
@stopped = Concurrent::AtomicBoolean.new(false)
|
|
32
|
+
@stop_event = Concurrent::Event.new
|
|
16
33
|
@worker = nil
|
|
17
34
|
@name = name
|
|
18
35
|
end
|
|
19
36
|
|
|
20
37
|
def start
|
|
21
38
|
@worker = Thread.new do
|
|
22
|
-
|
|
39
|
+
@stop_event.wait(@start_delay) unless @start_delay.nil? || @start_delay == 0
|
|
23
40
|
|
|
24
41
|
until @stopped.value do
|
|
25
42
|
started_at = Time.now
|
|
@@ -29,19 +46,23 @@ module LaunchDarkly
|
|
|
29
46
|
Impl::Util.log_exception(@logger, "Uncaught exception from repeating task", e)
|
|
30
47
|
end
|
|
31
48
|
delta = @interval - (Time.now - started_at)
|
|
32
|
-
if delta > 0
|
|
33
|
-
sleep(delta)
|
|
34
|
-
end
|
|
49
|
+
@stop_event.wait(delta) if delta > 0
|
|
35
50
|
end
|
|
36
51
|
end
|
|
37
52
|
|
|
38
53
|
@worker.name = @name
|
|
39
54
|
end
|
|
40
55
|
|
|
56
|
+
#
|
|
57
|
+
# Stops the worker thread and waits for it to finish.
|
|
58
|
+
#
|
|
59
|
+
# This method is safe to call more than once, before `start`, and from
|
|
60
|
+
# inside the task itself.
|
|
61
|
+
#
|
|
41
62
|
def stop
|
|
42
63
|
if @stopped.make_true
|
|
64
|
+
@stop_event.set
|
|
43
65
|
if @worker && @worker.alive? && @worker != Thread.current
|
|
44
|
-
@worker.run # causes the thread to wake up if it's currently in a sleep
|
|
45
66
|
@worker.join
|
|
46
67
|
end
|
|
47
68
|
end
|
|
@@ -487,7 +487,7 @@ module LaunchDarkly
|
|
|
487
487
|
#
|
|
488
488
|
class FlagRuleBuilder
|
|
489
489
|
# @api private
|
|
490
|
-
FlagRuleClause = Struct.new(:contextKind, :attribute, :op, :values, :negate, keyword_init: true) # rubocop:disable Naming/MethodName
|
|
490
|
+
FlagRuleClause = Struct.new(:contextKind, :attribute, :op, :values, :negate, keyword_init: true) # rubocop:disable Naming/MethodName
|
|
491
491
|
|
|
492
492
|
# @api private
|
|
493
493
|
def initialize(flag_builder)
|
data/lib/ldclient-rb/ldclient.rb
CHANGED
|
@@ -81,6 +81,10 @@ module LaunchDarkly
|
|
|
81
81
|
# The pid of the process in which the fork warning was last logged, or nil.
|
|
82
82
|
@fork_warned_pid = Concurrent::AtomicReference.new(nil)
|
|
83
83
|
|
|
84
|
+
# Each flag lets the matching cached-data warning log once per client.
|
|
85
|
+
@cached_data_evaluation_warned = Concurrent::AtomicBoolean.new(false)
|
|
86
|
+
@cached_data_all_flags_warned = Concurrent::AtomicBoolean.new(false)
|
|
87
|
+
|
|
84
88
|
start_up(wait_for_sec)
|
|
85
89
|
end
|
|
86
90
|
|
|
@@ -629,7 +633,9 @@ module LaunchDarkly
|
|
|
629
633
|
|
|
630
634
|
unless initialized?
|
|
631
635
|
if @data_system.store.initialized?
|
|
632
|
-
|
|
636
|
+
if @cached_data_all_flags_warned.make_true
|
|
637
|
+
@config.logger.warn { "Called all_flags_state before client initialization; using last known values from data store. This message is logged once." }
|
|
638
|
+
end
|
|
633
639
|
else
|
|
634
640
|
@config.logger.warn { "Called all_flags_state before client initialization. Data store not available; returning empty state" }
|
|
635
641
|
return FeatureFlagsState.new(false)
|
|
@@ -765,7 +771,9 @@ module LaunchDarkly
|
|
|
765
771
|
|
|
766
772
|
if @data_system.data_availability != Impl::DataSystem::DataAvailability::REFRESHED
|
|
767
773
|
if @data_system.data_availability == Impl::DataSystem::DataAvailability::CACHED
|
|
768
|
-
@
|
|
774
|
+
if @cached_data_evaluation_warned.make_true
|
|
775
|
+
@config.logger.warn { "[LDClient] Client has not finished initializing; using last known values from feature store. This message is logged once." }
|
|
776
|
+
end
|
|
769
777
|
else
|
|
770
778
|
@config.logger.error { "[LDClient] Client has not finished initializing; feature store unavailable, returning default value" }
|
|
771
779
|
detail = Evaluator.error_result(EvaluationReason::ERROR_CLIENT_NOT_READY, default)
|
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.18.0
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- LaunchDarkly
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-09-
|
|
10
|
+
date: 2026-09-16 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: aws-sdk-dynamodb
|
|
@@ -331,16 +331,22 @@ dependencies:
|
|
|
331
331
|
name: json
|
|
332
332
|
requirement: !ruby/object:Gem::Requirement
|
|
333
333
|
requirements:
|
|
334
|
-
- - "
|
|
334
|
+
- - ">="
|
|
335
335
|
- !ruby/object:Gem::Version
|
|
336
336
|
version: '2.3'
|
|
337
|
+
- - "<"
|
|
338
|
+
- !ruby/object:Gem::Version
|
|
339
|
+
version: '4'
|
|
337
340
|
type: :runtime
|
|
338
341
|
prerelease: false
|
|
339
342
|
version_requirements: !ruby/object:Gem::Requirement
|
|
340
343
|
requirements:
|
|
341
|
-
- - "
|
|
344
|
+
- - ">="
|
|
342
345
|
- !ruby/object:Gem::Version
|
|
343
346
|
version: '2.3'
|
|
347
|
+
- - "<"
|
|
348
|
+
- !ruby/object:Gem::Version
|
|
349
|
+
version: '4'
|
|
344
350
|
description: Official LaunchDarkly SDK for Ruby
|
|
345
351
|
email:
|
|
346
352
|
- team@launchdarkly.com
|