Skip to content

Commit

Permalink
FFM-1928 - Example extended.
Browse files Browse the repository at this point in the history
  • Loading branch information
milos85vasic committed Dec 15, 2021
1 parent c7e1b59 commit 96b7fab
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/io/harness/cf/client/example/Example.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.gson.JsonObject;
import io.harness.cf.client.api.CfClient;
import io.harness.cf.client.api.Config;
import io.harness.cf.client.api.FeatureFlagInitializeException;
import io.harness.cf.client.api.FileMapStore;
import io.harness.cf.client.dto.Target;
import java.util.HashMap;
Expand Down Expand Up @@ -58,6 +59,18 @@ public static void main(String... args) {
.name("Target_" + random)
.build();

try {

client.waitForInitialization();

} catch (InterruptedException | FeatureFlagInitializeException e) {

log.error(e.getMessage());
System.exit(1);
}

log.info("Client is ready: " + keyName + ", " + client.hashCode());

scheduler.scheduleAtFixedRate(
() -> {
final boolean bResult = client.boolVariation("flag1", target, false);
Expand Down

0 comments on commit 96b7fab

Please sign in to comment.