private CompletableFuture<Boolean> initEndpointGroup(EndpointGroup endpointGroup) {
        this.endpointGroup = endpointGroup;
        final Endpoint endpoint = endpointGroup.selectNow(this);
        if (endpoint != null) {
            updateEndpoint(endpoint);
            acquireEventLoop(endpointGroup);
            return initFuture(true, null);
        }

        // Use an arbitrary event loop for asynchronous Endpoint selection.
        final EventLoop temporaryEventLoop = options().factory().eventLoopSupplier().get();
        return endpointGroup.select(this, temporaryEventLoop).handle((e, cause) -> {
            updateEndpoint(e);
            acquireEventLoop(endpointGroup);

            final boolean success;
            if (cause != null) {
                failEarly(cause);
                success = false;
            } else {
                success = true;
            }

            final EventLoop acquiredEventLoop = eventLoop();
            if (acquiredEventLoop == temporaryEventLoop) {
                // We were lucky. No need to hand over to other EventLoop.
                return initFuture(success, null);
            } else {
                // We need to hand over to the acquired EventLoop.
                return initFuture(success, acquiredEventLoop);
            }
        }).thenCompose(Function.identity());
    }
Creates a new instance. Note that {@link #init()} method must be invoked to finish
the construction of this context.

@param sessionProtocol the {@link SessionProtocol} of the invocation
@param id the {@link RequestId} that contains the identifier of the current {@link Request}
          and {@link Response} pair.
@param req the {@link HttpRequest} associated with this context
@param rpcReq the {@link RpcRequest} associated with this context
@param requestStartTimeNanos {@link System#nanoTime()} value when the request started.
@param requestStartTimeMicros the number of microseconds since the epoch,
                              e.g. {@code System.currentTimeMillis() * 1000}.
core/src/main/java/com/linecorp/armeria/internal/client/DefaultClientRequestContext.java