You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This class exposes advanced configuration options for the LaunchDarkly client library. Most users
7
+
# will not need to use a custom configuration-- the default configuration sets sane defaults for most use cases.
8
+
#
9
+
#
2
10
classConfig
3
-
definitialize(base_uri)
4
-
@base_uri=base_uri
11
+
#
12
+
# Constructor for creating custom LaunchDarkly configurations.
13
+
#
14
+
# @param opts [Hash] the configuration options
15
+
# @option opts [Logger] :logger A logger to use for messages from the LaunchDarkly client. Defaults to the Rails logger in a Rails environment, or stdout otherwise.
16
+
# @option opts [String] :base_uri ("https://app.launchdarkly.com") The base URL for the LaunchDarkly server. Most users should use the default value.
17
+
# @option opts [Integer] :capacity (10000) The capacity of the events buffer. The client buffers up to this many events in memory before flushing. If the capacity is exceeded before the buffer is flushed, events will be discarded.
18
+
# @option opts [Integer] :flush_interval (30) The number of seconds between flushes of the event buffer.
19
+
# @option opts [Object] :store A cache store for the Faraday HTTP caching library. Defaults to the Rails cache in a Rails environment, or a thread-safe in-memory store otherwise.
# @return [String] The configured base URL for the LaunchDarkly server.
7
34
defbase_uri
8
35
@base_uri
9
36
end
10
37
38
+
#
39
+
# The number of seconds between flushes of the event buffer. Decreasing the flush interval means
40
+
# that the event buffer is less likely to reach capacity.
41
+
#
42
+
# @return [Integer] The configured number of seconds between flushes of the event buffer.
43
+
defflush_interval
44
+
@flush_interval
45
+
end
46
+
47
+
#
48
+
# The configured logger for the LaunchDarkly client. The client library uses the log to
49
+
# print warning and error messages.
50
+
#
51
+
# @return [Logger] The configured logger
52
+
deflogger
53
+
@logger
54
+
end
55
+
56
+
#
57
+
# The capacity of the events buffer. The client buffers up to this many events in memory before flushing. If the capacity is exceeded before the buffer is flushed, events will be discarded.
58
+
# Increasing the capacity means that events are less likely to be discarded, at the cost of consuming more memory.
59
+
#
60
+
# @return [Integer] The configured capacity of the event buffer
61
+
defcapacity
62
+
@capacity
63
+
end
64
+
65
+
#
66
+
# The store for the Faraday HTTP caching library. Stores should respond to 'read' and 'write' requests.
67
+
#
68
+
# @return [Object] The configured store for the Faraday HTTP caching library.
69
+
defstore
70
+
@store
71
+
end
72
+
73
+
#
74
+
# The default LaunchDarkly client configuration. This configuration sets reasonable defaults for most users.
75
+
#
76
+
# @return [Config] The default LaunchDarkly configuration.
0 commit comments