--
You received this message because you are subscribed to the Google Groups "Siena" group.
To unsubscribe from this group and stop receiving emails from it, send an email to siena-discus...@googlegroups.com.
To post to this group, send email to siena-...@googlegroups.com.
Visit this group at http://groups.google.com/group/siena-discuss.
For more options, visit https://groups.google.com/groups/opt_out.
If you see stupid things that I may have misunderstood, don't hesitate. I'm not an expert in asynchronism and I spent lots of time studying GAE doc but this is not always very clear :)
Found your old post hereIf you see stupid things that I may have misunderstood, don't hesitate. I'm not an expert in asynchronism and I spent lots of time studying GAE doc but this is not always very clear :)
It moade me smile, as now you're one of the world asyncronism experts ;-)
I'm gonna play with Future and FutureWrapper (I've discovered it today...) as I spend a lot of time blocking with get() or even batch().
Also UrlFetch on GAE returns a Future, and since I use it, I'd like to see if I can use FutureWrapper as a callback.
FutureWrapper is a java class?
The other reason also is that GAE functions return a Future object. But then when you call the Future.get() function on it, it returns a GAE entity and not a Siena Entity.
What we want when we call .get() is to retrieve a Siena Model.
So we need to do the mapping to Siena Model also when calling the .get().
That's why I encapsulate the GAE Future into a SienaFutureWrapper (directly inherited from Google FutureWrapper) which provides the mapping feature. Look at the GaeAsyncPersistenceManager to see how it is used.
This wrapper is itself encapsulated into a SienaFutureContainer which allows to hide the Java Future Exception problem
FutureWrapper is a java class?Quoting Pascal Voitot:The other reason also is that GAE functions return a Future object. But then when you call the Future.get() function on it, it returns a GAE entity and not a Siena Entity.
What we want when we call .get() is to retrieve a Siena Model.
So we need to do the mapping to Siena Model also when calling the .get().
That's why I encapsulate the GAE Future into a SienaFutureWrapper (directly inherited from Google FutureWrapper) which provides the mapping feature. Look at the GaeAsyncPersistenceManager to see how it is used.
This wrapper is itself encapsulated into a SienaFutureContainer which allows to hide the Java Future Exception problemIt's quite clever actually ;-)I'm going through your async classes, and see if I can improve performances.Each call to get() or batch() blocks and spins up new instances.I can't say GAE is very good from that point of view, it's a real waste of resources.Perhaps, something really counter-intuitive, like an HttpRequest Thread that keeps pausing and checking if a result is back from a Future would be the most performant solution.
GAE suits us, as we have very few users but lots of (small) data. Costs are low, critical stuff is handled by task queues in a reliable way, mail handling is reliable.One just needs to work around its limitations: (really) slow datastore, and expensive datastore access.
I love how you can deploy new code over running instances, and having multiple versions or multiple apps at the click of a button.That's the old GAE for you, it suits one man band operations for few enterprise users.
--
BTW I've just reminded that Guava provides some Future classes which could help you. I must say Java Future is just a joke... JDK8 will provide some better things but with crazy long stupid names... Anyway, it will be better!
AWS is ~~~everything expensive, that's certainly why GAE still lives (and because Google is behind :))