Hi Raghavv, The memcache API provides the ability to atomically increment an integer key, and return the old value. You can use this feature to build an efficient circular buffer that supports hopefully consistent updates. I started such a class here: <http://www.pastie.org/427122> (note this code has at least one major bug, use it as a guide only!).
Note that the AppEngine documentation provides no guarantees about the locality or consistency across multiple keys, so the approach I took might not be valid. David. 2009/3/25 ragh...@gmail.com <ragh...@gmail.com>: > > I am trying to create a 'user activity' queue in memcache. Example: > > User1 logged in at time t1 > User2 logged out at time t2 > User1 played poker at time t3 > User1 updated profile at time t4 > > Data as in above example, is stored in memcache with key name = > "ActivityQueue" > > At any given time, I need all the activities done in last 5 minutes. I > have a choice of doing it in data-store but would like to avoid it due > to performance reasons. I don't need persistence for this data. > > Unless updates to the ActivityQueue are synchronized, I will lose > certain updated. > > Is there a way to synchronize updates to memcache? i.e. at any given > time only one request can append to the queue. Anybody with better > idea on how to do queuing? > > > > -- It is better to be wrong than to be vague. — Freeman Dyson --~--~---------~--~----~------------~-------~--~----~ 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 google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---