Skip to content

Commit

Permalink
feat: complete java example (#8227)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaanus authored Sep 24, 2024
1 parent fee2143 commit 272052c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions frontend/src/component/onboarding/sdkSnippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dotnet add package Newtonsoft.Json`,
Java: `<dependency>
<groupId>io.getunleash</groupId>
<artifactId>unleash-client-java</artifactId>
<version>Latest version here</version>
<version>LATEST</version>
</dependency>`,
Python: 'pip install UnleashClient',
JavaScript: 'npm install unleash-proxy-client',
Expand Down Expand Up @@ -95,6 +95,7 @@ var settings = new UnleashSettings()
.instanceId("unleash-onboarding-instance")
.unleashAPI("<YOUR_API_URL>")
.apiKey("<YOUR_API_TOKEN>")
.sendMetricsInterval(5)
.build();
Unleash unleash = new DefaultUnleash(config);`,
Expand Down Expand Up @@ -218,7 +219,11 @@ export const checkFlagCodeSnippets: Record<SdkName, string> = {
`,
Rust: ``,
'.NET': ``,
Java: ``,
Java: `while (true) {
boolean featureEnabled = unleash.isEnabled("<YOUR_FLAG>");
System.out.println("Feature enabled: " + featureEnabled);
Thread.sleep(1000);
}`,
Python: `while True:
print(client.is_enabled("<YOUR_FLAG>"))
asyncio.run(asyncio.sleep(1))`,
Expand Down

0 comments on commit 272052c

Please sign in to comment.