code: @Override
  	public Promise waitForServices(long timeoutMillis, Collection<String> services) {
  		if (services == null || services.isEmpty() || isServicesOnline(services)) {
  			return Promise.resolve();
  		}
  		Promise promise = new Promise();
  		long timeoutAt;
  		if (timeoutMillis > 0) {
  			timeoutAt = System.currentTimeMillis() + timeoutMillis;
  		} else {
  			timeoutAt = 0;
  		}
  		ServiceListener listener = new ServiceListener(promise, timeoutAt, services);
  		synchronized (serviceListeners) {
  			serviceListeners.addLast(listener);
  			if (servicesOnlineTimer == null) {
  				servicesOnlineTimer = scheduler.scheduleWithFixedDelay(this::checkServicesOnline, 1, 1,
  						TimeUnit.SECONDS);
  			}
  		}
  		return promise;
  	}
docs: --- WAIT FOR SERVICE(S) ---