- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我正在使用 Cloud Endpoints 和 Go,我正在尝试使用 goroutine 以异步方式调用方法。
当我在本地运行以下代码时,我可以看到调试打印,但在服务器上似乎没有调用该方法。
我基本上是在尝试做
go doStuff()
return type
最佳答案
AppEngine 的 Go 运行时支持 goroutines,引用自文档:Go Runtime Environment: Introduction :
The Go runtime environment for App Engine provides full support for goroutines, but not for parallel execution: goroutines are scheduled onto a single operating system thread.
问题是当你的 HandleFunc()
或 Handler.ServeHTTP()
返回时,AppEngine 平台(以及 http
包)不会等待处理函数启动的任何 goroutine 完成。
引自文档:Handling Requests: Responses :
App Engine calls the handler with a
Request
and aResponseWriter
, then waits for the handler to write to theResponseWriter
and return. When the handler returns, the data in theResponseWriter
's internal buffer is sent to the user.
您必须同步您的请求处理和 goroutine,并且仅在 goroutine 完成其工作后才返回,例如:
func doStuff(done chan int) {
// Do your stuff
// and finally signal that you're done:
done <- 0
}
func someHandler(w http.ResponseWriter, r *http.Request) {
done := make(chan int)
go doStuff(done)
// Wait for the goroutine to complete:
<-done
}
关于google-app-engine - 如何在 AppEngine 中使用 goroutine?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30369661/
我正在尝试将gradle appengine plugin与我的项目一起使用,但SDK的软件包未得到解决。 我在网上看到很多Maven资料库的引用资料:com.google.appengine:app
我对 gradle 概念很陌生。我正在为应用程序引擎做 gradle (我不知道 maven 或 ant),我经历了 [https://cloud.google.com/appengine/docs/
我使用 maven 3.3.9 使用命令 mvn archetype:generate 创建了一个项目,然后搜索端点 archtype 并选择它,然后插入 groupid artifectId 版本.
这个问题已经有答案了: 已关闭12 年前。 Possible Duplicate: How to implement “autoincrement” on Google AppEngine 我在 Ap
对于我的小框架 Pyxer我希望也能够在 AppEngine 项目之外使用 Google AppEngine 数据存储,因为我现在已经习惯了这种 ORM 模式,对于一些快速的破解来说,这很好。由于文件
我正在尝试 GAE Java 灵活环境并在我的构建脚本中使用“com.google.appengine:gradle-appengine-plugin:gradle-appengine-plugin”
我是 GAE 的大菜鸟,Python 水平中等,Java 中等至生疏。我希望将现有的可用 GAE Java 应用程序(在 Google Play 商店中并在 Android 上运行)转换为 GAE P
我的 AppEngine Java8 应用程序缺少 appengine-api-1.0-sdk-1.9.77.jar。无论我调用什么 servlet,我都会收到此错误 java.lang.NoClas
我正在尝试在请求中获取地区和国家。我认为可以在对 AppEngine 的每个请求中获取 X-AppEngine-Region 和 X-AppEngine-Country header ,但它们丢失了。
我们正在从非官方的“kidleit”maven 插件切换为使用官方的“appengine-maven-plugin”http://code.google.com/p/appengine-maven-p
我正在构建一个 Maven 应用程序,我想将其部署在 Java 的 Google 应用程序引擎上。 我尝试在本地服务器中进行测试 localhost:8080 当我运行命令mvn clean pack
如何在 AppEngine 中使用 X-AppEngine-Estimated-CPM-US-Dollars header 。我读了一些文档,我们可以只使用管理员凭据来使用它,这是什么意思? 如果您有
当我尝试使用 appengine-maven-plugin 更新 appengine-application 时出现以下错误: 400 Bad Request Error when loading a
当我尝试在 AppEngine 中使用低级 DataStore API 时,我收到了一个有趣的 ClassNotFoundException。此异常发生在云服务器中,而不是本地实例中。我在本地使用 a
我在尝试运行我的应用程序时遇到以下错误 from oauth2client.appengine import oauth2decorator_from_clientsecrets ImportErro
情况 我正在使用 AppEngine Cloud Endpoints (Java)作为我的 Android 应用程序的后端服务器。在 Cron-Job 中,服务器定期下载新数据(字符串),过滤掉相关信
我有一个多模块 Maven java 项目。在父 pom 中: core batch-worker be scheduler migrations migr
我们正在尝试从 oauth2client 导入 AppAssertionCredentials。我们正在使用 python27 标准谷歌应用程序引擎。 我们的appengine_config.py如下
有什么区别mvn appengine:更新和Google App Engine 中的 mvn appengine:deploy。 最佳答案 这取决于您为项目使用的配置。 old AppEngine p
从语义上讲,api 和ext 指的是什么意思?例如,为什么 taskqueue 属于 api 而 db 属于 ext? 最佳答案 API = 应用程序编程接口(interface)。 所以我们通过它的
我是一名优秀的程序员,十分优秀!