@@ -22,7 +22,7 @@ def __init__(self,
22
22
send_events = None ,
23
23
events_enabled = True ,
24
24
update_processor_class = None ,
25
- poll_interval = 1 ,
25
+ poll_interval = 30 ,
26
26
use_ldd = False ,
27
27
feature_store = InMemoryFeatureStore (),
28
28
feature_requester_class = None ,
@@ -31,16 +31,47 @@ def __init__(self,
31
31
all_attributes_private = False ,
32
32
offline = False ):
33
33
"""
34
-
35
- :param update_processor_class: A factory for an UpdateProcessor implementation taking the sdk key, config,
36
- and FeatureStore implementation
34
+ :param string sdk_key: The SDK key for your LaunchDarkly account.
35
+ :param string base_uri: The base URL for the LaunchDarkly server. Most users should use the default
36
+ value.
37
+ :param string events_uri: The URL for the LaunchDarkly events server. Most users should use the
38
+ default value.
39
+ :param float connect_timeout: The connect timeout for network connections in seconds.
40
+ :param float read_timeout: The read timeout for network connections in seconds.
41
+ :param int events_upload_max_batch_size: The maximum number of analytics events that the client will
42
+ send at once.
43
+ :param int events_max_pending: The capacity of the events buffer. The client buffers up to this many
44
+ events in memory before flushing. If the capacity is exceeded before the buffer is flushed, events
45
+ will be discarded.
46
+ :param string stream_uri: The URL for the LaunchDarkly streaming events server. Most users should
47
+ use the default value.
48
+ :param bool stream: Whether or not the streaming API should be used to receive flag updates. By
49
+ default, it is enabled. Streaming should only be disabled on the advice of LaunchDarkly support.
50
+ :param bool send_events: Whether or not to send events back to LaunchDarkly. This differs from
51
+ `offline` in that it affects only the sending of client-side events, not streaming or polling for
52
+ events from the server. By default, events will be sent.
53
+ :param bool events_enabled: Obsolete name for `send_events`.
54
+ :param bool offline: Whether the client should be initialized in offline mode. In offline mode,
55
+ default values are returned for all flags and no remote network requests are made. By default,
56
+ this is false.
37
57
:type update_processor_class: (str, Config, FeatureStore) -> UpdateProcessor
58
+ :param float poll_interval: The number of seconds between polls for flag updates if streaming is off.
59
+ :param bool use_ldd: Whether you are using the LaunchDarkly relay proxy in daemon mode. In this
60
+ configuration, the client will not use a streaming connection to listen for updates, but instead
61
+ will get feature state from a Redis instance. The `stream` and `poll_interval` options will be
62
+ ignored if this option is set to true. By default, this is false.
63
+ :param array private_attribute_names: Marks a set of attribute names private. Any users sent to
64
+ LaunchDarkly with this configuration active will have attributes with these names removed.
65
+ :param bool all_attributes_private: If true, all user attributes (other than the key) will be
66
+ private, not just the attributes specified in `private_attribute_names`.
38
67
:param feature_store: A FeatureStore implementation
39
68
:type feature_store: FeatureStore
40
69
:param feature_requester_class: A factory for a FeatureRequester implementation taking the sdk key and config
41
70
:type feature_requester_class: (str, Config, FeatureStore) -> FeatureRequester
42
71
:param event_consumer_class: A factory for an EventConsumer implementation taking the event queue, sdk key, and config
43
72
:type event_consumer_class: (queue.Queue, str, Config) -> EventConsumer
73
+ :param update_processor_class: A factory for an UpdateProcessor implementation taking the sdk key,
74
+ config, and FeatureStore implementation
44
75
"""
45
76
self .__sdk_key = sdk_key
46
77
@@ -52,9 +83,7 @@ def __init__(self,
52
83
self .__stream_uri = stream_uri .rstrip ('\\ ' )
53
84
self .__update_processor_class = update_processor_class
54
85
self .__stream = stream
55
- if poll_interval < 1 :
56
- poll_interval = 1
57
- self .__poll_interval = poll_interval
86
+ self .__poll_interval = max (poll_interval , 30 )
58
87
self .__use_ldd = use_ldd
59
88
self .__feature_store = InMemoryFeatureStore () if not feature_store else feature_store
60
89
self .__event_consumer_class = EventConsumerImpl if not event_consumer_class else event_consumer_class
0 commit comments