>  
> -   @ConstructorProperties({ "kind", "nextPageToken", "items" })
> -   protected ListPage(Kind kind, String nextPageToken, Iterable<T> items) {
> -      this.kind = checkNotNull(kind, "kind");
> -      this.nextPageToken = nextPageToken;
> -      this.items = items != null ? ImmutableList.copyOf(items) : 
> ImmutableList.<T>of();
> +   public ListPage(PageWithMarker<T> delegate, Function<PageWithMarker<T>, 
> PagedIterable<T>> advancingFunction) {

Will followup more completely later.. maybe :) since maybe I will answer
best now.

One thing to keep in mind that in many cases there will be only one page of
results. In this case the leak risk, as well the bloated class is
unnecessary.

It may be possible in the current design to special case this.

Also we had a meetup with clojure folks back in the day (specifically toni
batchelli) who specifically asked to not have auto advancing mandatory as
it introduces risk of crossing network boundaries on simple iteration. They
preferred to manage their own pagination.

In all, I think this change is a step backwards or at best neutral, from a
user pov. It Is less copy paste from implementer pov.

I am not focused on it or the several other patterns we use, and admit that
we can defer a better list for a new version (maybe v2)

In the mean time, feel free to merge this, taking into consideration what
you feel is most time and version relevant. We can always copy paste these
methods back.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/62/files#r19288954

Reply via email to