使用 Google 云函数调用 App Engine 任务队列

Call App Engine Task Queue using Google Cloud Functions

我在 Google App Engine 任务队列中创建了一个推送队列。

队列名称:默认 任务名称:[自动生成]

我正在尝试从 Google Cloud Functions 调用此任务队列,但无法了解其工作原理。

由于 Cloud Functions 运行 不在标准环境 GAE 中,您将无法使用任务队列。 Task Queue:

中提到了一些可能的替代方案

The Task Queue service has limited availability outside of the standard environment. If you want to use the service outside of the standard environment, you can sign up for the Cloud Tasks alpha.

Outside of the standard environment, you can't add tasks to push queues, but a service running in the flexible environment can be the target of a push task. You can specify this using the target parameter when adding a task to queue or by specifying the default target for the queue in queue.yaml.

In many cases where you might use pull queues, such as queuing up tasks or messages that will be pulled and processed by separate workers, Cloud Pub/Sub can be a good alternative as it offers similar functionality and delivery guarantees.