mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
feat: complete java example (#8227)
This commit is contained in:
parent
fee2143edf
commit
272052c59b
@ -12,7 +12,7 @@ dotnet add package Newtonsoft.Json`,
|
|||||||
Java: `<dependency>
|
Java: `<dependency>
|
||||||
<groupId>io.getunleash</groupId>
|
<groupId>io.getunleash</groupId>
|
||||||
<artifactId>unleash-client-java</artifactId>
|
<artifactId>unleash-client-java</artifactId>
|
||||||
<version>Latest version here</version>
|
<version>LATEST</version>
|
||||||
</dependency>`,
|
</dependency>`,
|
||||||
Python: 'pip install UnleashClient',
|
Python: 'pip install UnleashClient',
|
||||||
JavaScript: 'npm install unleash-proxy-client',
|
JavaScript: 'npm install unleash-proxy-client',
|
||||||
@ -95,6 +95,7 @@ var settings = new UnleashSettings()
|
|||||||
.instanceId("unleash-onboarding-instance")
|
.instanceId("unleash-onboarding-instance")
|
||||||
.unleashAPI("<YOUR_API_URL>")
|
.unleashAPI("<YOUR_API_URL>")
|
||||||
.apiKey("<YOUR_API_TOKEN>")
|
.apiKey("<YOUR_API_TOKEN>")
|
||||||
|
.sendMetricsInterval(5)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Unleash unleash = new DefaultUnleash(config);`,
|
Unleash unleash = new DefaultUnleash(config);`,
|
||||||
@ -218,7 +219,11 @@ export const checkFlagCodeSnippets: Record<SdkName, string> = {
|
|||||||
`,
|
`,
|
||||||
Rust: ``,
|
Rust: ``,
|
||||||
'.NET': ``,
|
'.NET': ``,
|
||||||
Java: ``,
|
Java: `while (true) {
|
||||||
|
boolean featureEnabled = unleash.isEnabled("<YOUR_FLAG>");
|
||||||
|
System.out.println("Feature enabled: " + featureEnabled);
|
||||||
|
Thread.sleep(1000);
|
||||||
|
}`,
|
||||||
Python: `while True:
|
Python: `while True:
|
||||||
print(client.is_enabled("<YOUR_FLAG>"))
|
print(client.is_enabled("<YOUR_FLAG>"))
|
||||||
asyncio.run(asyncio.sleep(1))`,
|
asyncio.run(asyncio.sleep(1))`,
|
||||||
|
Loading…
Reference in New Issue
Block a user