> With the new code, we have a python object rather than a model I can
> get_or_insert

My modified counter uses a simple python object (rather than a model)
at the level above the shards.  Shard models are still used so when
you change a counter, you'll invoke a get_or_insert style transaction
at the shard level.   If you look at the other counter
implementations, you'll see that a high-level Counter model stores
data like counter name and number of shards.  Since I handle counter
names and # of shards at the program level, hardwired to particular
tasks, my version simply bypasses those Counter entities as not
necessary.

Stat-like tasks like your use case are a good fit for the approach
I've taken because counter accuracy (although very likely) is not
guaranteed.  For example, if you have a string of datastore timeouts
and your memcache goes away, the counter will be inaccurate.  In cases
where it's essential for accurate counts or knowledge that it's
failed, simply returning errors and handling it on the client side
seems better.

But unless I'm misunderstanding your question, you should be able to
just always instantiate the Counter object and use it.
-Bill
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
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