-
public final class LatchAwaiterThis class allows blocking execution until asynchronous initialization or completion is signaled, with support for configurable timeouts and detailed logging for troubleshooting. It is designed for scenarios where certain tasks, such as SDK initialization, must finish before continuing. When used on the main/UI thread, it applies a shorter timeout and logs a thread stack trace to warn developers, helping to prevent Application Not Responding (ANR) errors caused by blocking the UI thread.
Usage: val awaiter = LatchAwaiter("OneSignal SDK Init") awaiter.release() // when done
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classLatchAwaiter.Companion
-
Constructor Summary
Constructors Constructor Description LatchAwaiter(String componentName)
-