Skip to content

Commit

Permalink
adding a small note about waitable
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins authored and manusa committed Jan 11, 2023
1 parent 8dc70e5 commit 5eb1277
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public interface Waitable<T, P> {
* Wait for the given condition to be true.
* <p>
* The processing of events will be in the IO thread, blocking operations should be avoided.
*
* <p>
* If nothing exists, the condition will be tested with a null value.
*
* @param condition
* @param amount
* @param timeUnit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ public static void initCrd() {
client.apiextensions().v1().customResourceDefinitions()
.withName("satellites.demos.fabric8.io")
.waitUntilCondition(
c -> c.getStatus() != null && c.getStatus().getConditions() != null && c.getStatus().getConditions().stream()
.anyMatch(crdc -> crdc.getType().equals("Established") && crdc.getStatus().equals("True")),
c -> c != null && c.getStatus() != null && c.getStatus().getConditions() != null
&& c.getStatus().getConditions().stream()
.anyMatch(crdc -> crdc.getType().equals("Established") && crdc.getStatus().equals("True")),
10L, TimeUnit.SECONDS);
}

Expand Down

0 comments on commit 5eb1277

Please sign in to comment.