I can not find the lock feature of memcache.
It's easy to set a flag somewhere in the memcache (got Lock)
The problem is: how the other request
when it hits the locked flag to wait for the lock to be released.

A quick and very drity solution is (maybe not even work, just for concept):

client = memcache.Client()
locked = client.get('lock')
while locked:
     ## wait for another request to release the lock
     time.sleep(1)
     locked = client.get('lock')
locked = client.set('lock',1)
.....
locked = client.set('lock',0)

Is there better way than "while ..sleep?" to block the request for a moment?

-- 
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-appeng...@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.

Reply via email to