示例#1
0
func startPoller(w http.ResponseWriter, r *http.Request) {
	ctx := appengine.NewContext(r)
	err := runtime.RunInBackground(ctx, poller)
	if err != nil {
		http.Error(w, err.Error(), 500)
	}
}
示例#2
0
文件: util.go 项目: speedland/service
// RunInBackground a wrapper for runtime.RunInBackground
func RunInBackground(req *wcg.Request, f func(*wcg.Request)) {
	bgReq := req.Clone()
	runtime.RunInBackground(NewContext(req), func(ctx context.Context) {
		bgReq.SetLocal("__gaebg_context", ctx)
		f(bgReq)
	})
}