/** * Awaits the drainage of connections, blocks until no more open * connections remain. * * @throws InterruptedException If this thread was interrupted. */ default void drain() throws InterruptedException { Await.perpetual(getEndpointManager().getEndpoints()::isEmpty); } }