@Override
	public void register(EurekaRegistration reg) {
		if (eurekaInstanceConfigBean != null && eurekaInstanceConfigBean.isAsyncClientInitialization()) {
			if (log.isDebugEnabled()) {
				log.debug("Initializing client asynchronously...");
			}

			ExecutorService executorService = Executors.newSingleThreadExecutor();
			executorService.submit(() -> {
				maybeInitializeClient(reg);
				if (log.isDebugEnabled()) {
					log.debug("Asynchronous client initialization done.");
				}
			});
		}
		else {
			maybeInitializeClient(reg);
		}

		if (log.isInfoEnabled()) {
			log.info("Registering application " + reg.getApplicationInfoManager().getInfo().getAppName()
					+ " with eureka with status " + reg.getInstanceConfig().getInitialStatus());
		}

		reg.getApplicationInfoManager().setInstanceStatus(reg.getInstanceConfig().getInitialStatus());

		reg.getHealthCheckHandler()
			.ifAvailable(healthCheckHandler -> reg.getEurekaClient().registerHealthCheck(healthCheckHandler));
	}
@author Spencer Gibb
@author Robert Bleyl
spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/serviceregistry/EurekaServiceRegistry.java