gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 15:23:15 26 4
gpt4 key购买 nike

当在 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com