Skip to content

Commit 46f2844

Browse files
nateriddermanNate Ridderman
andauthored
docs: Documentation updates (#58)
* Fix some argument names in README.md * PollingModes.autoPoll is actually in seconds * fix javadoc: pollRateDuration is actually in milliseconds --------- Co-authored-by: Nate Ridderman <[email protected]>
1 parent a470087 commit 46f2844

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Configuring a client with a 60 seconds poll interval:
8989
val config = UnleashConfig.newBuilder()
9090
.proxyUrl("URL to your front-end API or proxy")
9191
.clientKey("your front-end API token or proxy client key")
92-
.pollMode(PollingModes.autoPoll(60000) { // poll interval in milliseconds
92+
.pollingMode(PollingModes.autoPoll(60) { // poll interval in seconds
9393
featuresUpdated()
9494
})
9595
.build()
@@ -106,7 +106,7 @@ import io.getunleash.polling.PollingModes
106106
val toggles = File("/tmp/proxyresponse.json")
107107
val pollingMode = PollingModes.fileMode(toggles)
108108

109-
val unleashConfig = UnleashConfig.newBuilder()
109+
val config = UnleashConfig.newBuilder()
110110
.proxyUrl("Doesn't matter since we don't use it when sent a file")
111111
.clientKey("Doesn't matter since we don't use it when sent a file")
112112
.pollMode(pollingMode)
@@ -119,7 +119,7 @@ Having created your UnleashContext and your UnleashConfig you can now instantiat
119119
```kotlin
120120
import io.getunleash.UnleashClient
121121

122-
val unleashClient = UnleashClient(config = unleashConfig, context = myAppContext)
122+
val unleashClient = UnleashClient(unleashConfig = config, unleashContext = context)
123123
```
124124

125125
### Details
@@ -143,11 +143,11 @@ val context = UnleashContext.newBuilder()
143143
val config = UnleashConfig.newBuilder()
144144
.proxyUrl("URL to your front-end API or proxy")
145145
.clientKey("your front-end API token or proxy client key")
146-
.pollMode(PollingModes.autoPoll(60000) { poll interval in milliseconds
146+
.pollingMode(PollingModes.autoPoll(60) { // poll interval in seconds
147147
featuresUpdated()
148148
})
149149
.build()
150-
val client = UnleashClient(config = config, unleashContext = context)
150+
val client = UnleashClient(unleashConfig = config, unleashContext = context)
151151
```
152152

153153
##### FilePolling (since v0.2)
@@ -166,9 +166,9 @@ val context = UnleashContext.newBuilder()
166166
val config = UnleashConfig.newBuilder()
167167
.proxyUrl("URL to your front-end API or proxy") // These two don't matter for FilePolling,
168168
.clientKey("front-end API token / proxy client key") // since the client never speaks to the proxy
169-
.pollMode(pollingMode)
169+
.pollingMode(pollingMode)
170170
.build()
171-
val client = UnleashClient(config = config, unleashContext = context)
171+
val client = UnleashClient(unleashConfig = config, unleashContext = context)
172172

173173
```
174174

src/main/kotlin/io/getunleash/polling/AutoPollingMode.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.getunleash.polling
22

33
/**
4-
* @param pollRateDuration - How long (in seconds) between each poll
4+
* @param pollRateDuration - How long (in milliseconds) between each poll
55
* @param togglesUpdatedListener - A listener that will be notified each time a poll actually updates the evaluation result
66
* @param erroredListener - A listener that will be notified each time a poll fails. The notification will include the Exception
77
* @param togglesCheckedListener - A listener that will be notified each time a poll completed. Will be called regardless of the check succeeded or failed.

0 commit comments

Comments
 (0)