douyujun0152 2013-01-22 07:14
浏览 39

是否可以在没有http请求的情况下访问GAE数据存储区?

Is it possible to access GAE datastore without making an appengine context out of a http request? I want to be able to access the datastore in separate threads that do not have access to the app engine context. is this possible? or should i try to find a work around? the language im working in is Go btw...

EDIT: More info The reason i can't use pass all the appengine contexts down to the level needed is because im building a chat server with multiple threads. Once the main port listening thread is started, with the one instance of a context, it keeps that context around for the duration of the thread. However, after that thread starts, there can be many more connections to the server all of which cant pass through a context because the port listener is already started. The reason i need the context passed all the way through is because i need to be able to log messages in the client read handler. Thanks in advance

  • 写回答

2条回答 默认 最新

  • doukuanjing5404 2013-01-22 20:57
    关注

    I think you'll need an appengine.Context (and therefore the request) for any datastore access. Fortunately the request should be easy enough to pass to whatever part of your code requires it.

    I'm not sure what appengine_internal does with the context, but the context itself can be passed back and forth as required. Maybe a code example would be a good next step if you don't think this will work for you?

    评论

报告相同问题?

悬赏问题

  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 组策略中的计算机配置策略无法下发
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)