class WeatherService implements AutoCloseable {

    public Observable<WeatherInfo> pastWeather(double lat, double log, LocalDate from, LocalDate to) {
        Stream<CompletableFuture<Stream<WeatherInfo>>> cfs = Stream
            .iterate(from, prev -> prev.withDayOfMonth(1).plusMonths(1))
            .takeWhile(dt -> dt.isBefore(to)) // Stream<LocalDate>
            .map(start -> {
                LocalDate end = min(start.withDayOfMonth(start.lengthOfMonth()), to);
                return webApi.pastWeather(lat, log, start, end);
            });// Stream<CF<Stream<WeatherInfo>>>

        return Observable
            .fromIterable(cfs::iterator)
            .map(WeatherService::toObservable)
            .flatMap(Functions.identity())
            .flatMap(strm -> Observable.fromIterable(strm::iterator));
    }

}