From 272052c59b43940471ff3119c5c8397ef108d613 Mon Sep 17 00:00:00 2001 From: Jaanus Sellin Date: Tue, 24 Sep 2024 09:55:54 +0300 Subject: [PATCH] feat: complete java example (#8227) --- frontend/src/component/onboarding/sdkSnippets.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/src/component/onboarding/sdkSnippets.ts b/frontend/src/component/onboarding/sdkSnippets.ts index a761bc667a45..d19bc41ade3b 100644 --- a/frontend/src/component/onboarding/sdkSnippets.ts +++ b/frontend/src/component/onboarding/sdkSnippets.ts @@ -12,7 +12,7 @@ dotnet add package Newtonsoft.Json`, Java: ` io.getunleash unleash-client-java - Latest version here + LATEST `, Python: 'pip install UnleashClient', JavaScript: 'npm install unleash-proxy-client', @@ -95,6 +95,7 @@ var settings = new UnleashSettings() .instanceId("unleash-onboarding-instance") .unleashAPI("") .apiKey("") + .sendMetricsInterval(5) .build(); Unleash unleash = new DefaultUnleash(config);`, @@ -218,7 +219,11 @@ export const checkFlagCodeSnippets: Record = { `, Rust: ``, '.NET': ``, - Java: ``, + Java: `while (true) { + boolean featureEnabled = unleash.isEnabled(""); + System.out.println("Feature enabled: " + featureEnabled); + Thread.sleep(1000); +}`, Python: `while True: print(client.is_enabled("")) asyncio.run(asyncio.sleep(1))`,