-
public final class LifecycleOnDestroyHelperHelps work around certain quirks of addObserver and DESTROYED.
In particular, calls to addObserver are silently ignored if the owner is already destroyed.
-
-
Method Summary
Modifier and Type Method Description static voidshutdownUponDestruction(Lifecycle lifecycle, ManagedChannel channel)Arranges for shutdownNow to be called on {@code channel}just before{@code lifecycle}is destroyed, or immediately if{@code lifecycle}is already destroyed.static voidshutdownUponDestruction(Lifecycle lifecycle, Server server)Arranges for shutdownNow to be called on {@code server}just before{@code * lifecycle}is destroyed, or immediately if{@code lifecycle}is already destroyed.-
-
Method Detail
-
shutdownUponDestruction
@MainThread() static void shutdownUponDestruction(Lifecycle lifecycle, ManagedChannel channel)
Arranges for shutdownNow to be called on
{@code channel}just before{@code lifecycle}is destroyed, or immediately if{@code lifecycle}is already destroyed.Must only be called on the application's main thread.
-
shutdownUponDestruction
@MainThread() static void shutdownUponDestruction(Lifecycle lifecycle, Server server)
Arranges for shutdownNow to be called on
{@code server}just before{@code * lifecycle}is destroyed, or immediately if{@code lifecycle}is already destroyed.Must only be called on the application's main thread.
-
-
-
-