英文:
GAE Go and long polling?
问题
在Google App Engine上实现长轮询的高效方法是什么?我找到了这个代码,但它是为非GAE应用程序设计的(使用通道和goroutine,据我所知,这不是GAE的最佳选择)。
编辑:
我特别需要为一个我无法控制的应用程序实现长轮询(参见这个参考),因此使用Channel API作为轮询的替代方法是不可行的。
英文:
What is an efficient way of implementing long polling in Golang on Google App Engine? I came across this code, but it was made for a non-GAE application (uses channels and goroutines, which as far as I know aren't the best for GAE).
EDIT:
I specifically need to implement long polling for an application I don't control (see this reference), thus the use of Channel API as a substitution for polling will not do.
答案1
得分: 2
前端实例对于HTTP请求有一个60秒的请求截止时间。您可以尝试使用后端实现长轮询,因为它们不受相同的限制(无限期截止时间)。
英文:
Frontend instance are subject to a 60s request deadline for http request.
You can try implementing long polling using Backends as they don't suffer the same limitation (infinite deadline).
答案2
得分: 0
你想要使用Channel API。
英文:
You want to use the Channel API.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论