- Notifications
You must be signed in to change notification settings - Fork 58
Closed
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Our current waiting logic could be improved. It is a working wait logic, but it might not be the most elegant solution.
Lines 26 to 38 in cd0ea9e
public static void busyWaitAndCheck(final Long deadline, final Supplier<Boolean> connectedSupplier) | |
throws InterruptedException { | |
long start = System.currentTimeMillis(); | |
do { | |
if (deadline <= System.currentTimeMillis() - start) { | |
throw new GeneralError(String.format( | |
"Deadline exceeded. Condition did not complete within the %d " + "deadline", deadline)); | |
} | |
Thread.sleep(50L); | |
} while (!connectedSupplier.get()); | |
} |
This task aims to migrate to an approach with notify()
and wait()
. As suggested by @chrfwow within #1115.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed