private void update() {
        if (isClosing()) {
            return;
        }

        final CompletableFuture<List<Endpoint>> response;
        final EventLoop eventLoop;
        try (ClientRequestContextCaptor captor = Clients.newContextCaptor()) {
            if (useHealthyEndpoints) {
                response = consulClient.healthyEndpoints(serviceName, datacenter, filter);
            } else {
                response = consulClient.endpoints(serviceName, datacenter, filter);
            }
            eventLoop = captor.get().eventLoop().withoutContext();
        }

        response.handle((endpoints, cause) -> {
            if (isClosing()) {
                return null;
            }
            if (cause != null) {
                logger.warn("Unexpected exception while fetching the registry from: {}" +
                            " (serviceName: {})", consulClient.uri(), serviceName, cause);
            } else if (endpoints != null) {
                setEndpoints(endpoints);
            }

            scheduledFuture = eventLoop.schedule(this::update, registryFetchIntervalMillis,
                                                 TimeUnit.MILLISECONDS);
            return null;
        });
    }
Returns a newly-created {@link ConsulEndpointGroupBuilder} with the specified {@code consulUri}
and {@code serviceName} to build {@link ConsulEndpointGroupBuilder}.

@param consulUri the URI of Consul API service
@param serviceName the service name to register
consul/src/main/java/com/linecorp/armeria/client/consul/ConsulEndpointGroup.java