您如何在Google App Engine中启动工作人员? [英] How do you start workers in Google App Engine?

查看:59
本文介绍了您如何在Google App Engine中启动工作人员?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Google App Engine上的Django应用中使用Celery.

I want to use Celery in a Django app I have on Google App Engine.

我的问题是:如何启动/运行工人?

My question is: how do I start/run the workers?

推荐答案

我不熟悉Celery,但是文档告诉我这是一个任务队列库.在这种情况下,最好改用 Google Tasks服务.长期以来,任务排队服务一直是App Engine的一大优势.

I'm not familiar with Celery but the docs tell me it is a task queuing library. In that case, you are probably better off using Google Tasks Service instead. The task queuing service has long been one of the big strengths of App Engine out of the box.

在App Engine经典版上,所有执行都是通过HTTP请求启动的.因此,如果您绝对必须在App Engine classic上坚持使用Celery,则需要找出一种方法,通过可能无限期运行的后端服务上的HTTP请求或通过触发固定工作线程的cron任务来启动工作线程.间隔.目前尚不清楚这两种方法是否可行,但可能会通过反复试验.

On App Engine classic all executions are started via an HTTP request. So If you absolutely must stick with Celery on App Engine classic, you would need to figure out a way to start the workers via an HTTP request possibly on a backend service that can run indefinitely, or via a cron task that triggers the worker at fixed intervals. It's unclear if either of these are workable, but they might be, it will take some trial and error.

或者,您可能希望使用 Google Compute Engine 实例来运行您的工作程序,或 App Engine Flexible ,它是GCE和App之间的中间地带引擎经典.

Alternatively, you might want to look at using a Google Compute Engine instance to run your workers, or possibly App Engine Flexible, which is sort of middle ground between the GCE and App Engine classic.

这篇关于您如何在Google App Engine中启动工作人员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆