google-app-engine - 如何通过 Google Cloud Pub/Sub API 接收长时间运行的操作结果

标签 google-app-engine google-cloud-platform google-cloud-pubsub google-cloud-speech

当在 Google Cloud API 中启动长时间运行的操作时,该服务可能会返回一个具有“Operations”形状的对象。然后可以通过该对象轮询操作的状态,并在完成时获得结果。

我想避免必须为这些结果设置自己的轮询过程,我希望可以利用 Google Cloud Pub/Sub 服务来提供帮助。我的希望来自阅读这一行 in the doc :

(强调)

... the client can use this interface to receive the real response asynchronously by polling the operation resource, or pass the operation resource to another API (such as Google Cloud Pub/Sub API) to receive the response. ...

是否可以使用 Google Cloud Pub/Sub API 来通知长时间运行的操作完成事件?我应该怎么做?

我无法在任何地方找到任何进一步的引用或使用此概念的示例。 也许我误解了该文档行?

干杯

最佳答案

您想使用的长时间运行的操作是否将结果写入云存储桶?如果是这样,您可以根据 this page 创建一个由该存储桶上的事件触发的云函数。 .

关于google-app-engine - 如何通过 Google Cloud Pub/Sub API 接收长时间运行的操作结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44568081/

相关文章:

node.js - 在 GAE Flex 上使用 admin SDK node.js 禁用 Firebase 数据库的日志记录

google-compute-engine - 在 Google Cloud Platform 上将 HTTP 负载均衡器与 Kubernetes 结合使用

google-cloud-pubsub - 有没有一种方法可以配置Google Cloud Pub/Sub的保留期?

google-bigquery - 与Google Pub/Sub + Dataflow相比,直接流入BigQuery的利弊

docker - 无法使用没有外部 IP 地址的容器镜像创建 Google Compute Engine 虚拟机

python - 如何在长时间运行的程序中立即确认 Pub/Sub 消息

django - 如何使用 Google App Engine 进行不区分大小写的过滤器查询?

google-app-engine - 谷歌云部署 - 用户禁用

python - Google App Engine 模型类是如何存储的?

security - 为什么 Google 建议将 CloudKMS 应用层加密与 Cloud Storage 结合使用?