Reputation: 1374
Is it possible to put a record to Google Cloud Datastore and a task to the TaskQueue atomically outside of App Engine using their REST APIs?
Basically achieve this (below) but in Container Engine and without using the high-level App Engine-specific APIs.
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) {
}
Upvotes: 3
Views: 131