@Blocking public interface BlockingHttpClient {
@Blocking public static String readText(BufferedReader reader) throws IOException { StringBuilder answer = new StringBuilder();
@Override @Blocking public Iterable<PropertySource> findPropertySources(Environment environment) throws ConfigurationException { if (LOG.isDebugEnabled()) { LOG.debug("Resolving configuration sources from client: {}", configurationClient); } try { Flowable<PropertySource> propertySourceFlowable = Flowable.fromPublisher(configurationClient.getPropertySources(environment)); List<PropertySource> propertySources = propertySourceFlowable.timeout( readTimeout.toMillis(), TimeUnit.MILLISECONDS ).toList().blockingGet(); if (LOG.isInfoEnabled()) { LOG.info("Resolved {} configuration sources from client: {}", propertySources.size(), configurationClient); } return propertySources; } catch (RuntimeException e) { if (e.getCause() instanceof TimeoutException) { throw new ConfigurationException("Read timeout occurred reading distributed configuration from client: " + configurationClient.getDescription(), e); } else { throw e; } } } }
/** * A blocking interface that will attempt to resolve either remote or local {@link PropertySource} instances * for the current Environment. * * @param environment The environment * @return An iterable of {@link PropertySource} * @throws ConfigurationException If the resolve fails and fail fast is set to true */ @Blocking Iterable<PropertySource> findPropertySources(Environment environment) throws ConfigurationException; }
/** * A blocking interface that will attempt to resolve either remote or local {@link PropertySource} instances * for the current Environment. * * @param environment The environment * @return An iterable of {@link PropertySource} * @throws ConfigurationException If the resolve fails and fail fast is set to true */ @Blocking Iterable<PropertySource> findPropertySources(Environment environment) throws ConfigurationException; }
@Blocking public interface BlockingHttpClient {
@Blocking public interface BlockingHttpClient {