On Thu, Jun 9, 2011 at 3:30 PM, Alfred Fuller
<[email protected]> wrote:
>
> Funny because we actually don't have this feature in python (only iterators
> async prefetch). Ya, I would hope coders would use asIterable() when doing a
> single for loop. The real win for asList() async prefetch is in these
> situations:
> List l = q.asList();  // returns immediately
> .... other work/rpcs...
> ... use l ...
> and
> // Launches and runs both queries in parallel
> List l1 = q1.asList();  // returns immediately
> List l2 = d2.asList();  // returns immediately
> ... use l1 and l2 ...

Ah, that makes total sense.

> The lazy list implementation in the low level is both lazy and serializable.
> You should be able to do something similar in Objectify.

This I don't understand.  Looking at LazyList I see it references
QueryResultIteratorImpl and has no way of fully populating itself on
serialization.  These classes might implement Serializable but you
sure can't serialize them!  At least not if you want a useful set of
data on the other side.

For example, this works right now:

List<Foo> myRemoteMethod() {
   return ObjectifyService.begin().query(Foo.class).list();
}

But unless I'm missing something really obvious, this will not work:

List<Entity> myRemoteMethod() {
   return DatastoreServiceFactory.getDatastoreService.prepare(new
Query("Foo")).asList();
}

Jeff

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to