gpt4 book ai didi

google-app-engine - Google 任务队列 JSON API 事务

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

是否可以使用 Google Cloud Datastore 的 REST API 在 App Engine 之外以原子方式将记录放入 Google Cloud Datastore 并将任务放入 TaskQueue?

基本实现this (如下)但在 Container Engine 中且未使用特定于 App Engine 的高级 API。

DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
Queue queue = QueueFactory.getDefaultQueue();
try {
Transaction txn = ds.beginTransaction();

// ...

queue.add(TaskOptions.Builder.withUrl("/path/to/my/worker"));

// ...
txn.commit();
} catch (DatastoreFailureException e) {
}

最佳答案

目前使用 Cloud Datastore API 无法做到这一点。

关于google-app-engine - Google 任务队列 JSON API 事务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29640609/

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