Skip to content

Commit

Permalink
docs: Documentation updates (#58)
Browse files Browse the repository at this point in the history
* 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 <nridderman@wayfair.com>
  • Loading branch information
nateridderman and Nate Ridderman committed Sep 7, 2023
1 parent a470087 commit 46f2844
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Configuring a client with a 60 seconds poll interval:
val config = UnleashConfig.newBuilder()
.proxyUrl("URL to your front-end API or proxy")
.clientKey("your front-end API token or proxy client key")
.pollMode(PollingModes.autoPoll(60000) { // poll interval in milliseconds
.pollingMode(PollingModes.autoPoll(60) { // poll interval in seconds
featuresUpdated()
})
.build()
Expand All @@ -106,7 +106,7 @@ import io.getunleash.polling.PollingModes
val toggles = File("/tmp/proxyresponse.json")
val pollingMode = PollingModes.fileMode(toggles)

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

val unleashClient = UnleashClient(config = unleashConfig, context = myAppContext)
val unleashClient = UnleashClient(unleashConfig = config, unleashContext = context)
```

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

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

```

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/io/getunleash/polling/AutoPollingMode.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.getunleash.polling

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

0 comments on commit 46f2844

Please sign in to comment.