So I finally decided I needed to figure out how to make it happen.
Here's a recipe for anyone else who wants to be able to access
memcache via remote_api:
1. copy the contents of /google/appengine/ext/remote_api/handler.py
into a new local file. i called mine remote_api_handler.py. then
change your app.yaml to point to this new local file.
2. add the following import to remote_api_handler.py:
from google.appengine.api.memcache import memcache_service_pb
3. in remote_api_handler.py, find the SERVICE_PB_MAP dictionary. add
the following as a new service:
'memcache': {
'Get': (memcache_service_pb.MemcacheGetRequest,
memcache_service_pb.MemcacheGetResponse),
'Delete': (memcache_service_pb.MemcacheDeleteRequest,
memcache_service_pb.MemcacheDeleteResponse),
'Increment': (memcache_service_pb.MemcacheIncrementRequest,
memcache_service_pb.MemcacheIncrementResponse),
'FlushAll': (memcache_service_pb.MemcacheFlushRequest,
memcache_service_pb.MemcacheFlushResponse),
'Stats': (memcache_service_pb.MemcacheStatsRequest,
memcache_service_pb.MemcacheStatsResponse),
'Set': (memcache_service_pb.MemcacheSetRequest,
memcache_service_pb.MemcacheSetResponse),
}
4. run your tests to make sure you haven't introduced any errors into
your code. deploy onto your server.
5. open /google/appengine/ext/remote_api/remote_api_stub.py. In the
ConfigureRemoteDatastore method, add the following two lines at the
end:
stub = RemoteStub(server, path)
apiproxy_stub_map.apiproxy.RegisterStub('memcache', stub)
(feel free to reimplement this in a less hacky way if you like... the
method could be renamed to include datastore and memcache
configuration.)
6. launch your remote_api console. enjoy access to memcache!
Hope that helps someone out.
Ben
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---