Upio
Upio

Reputation: 1374

Google Task Queues JSON API Transactions

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

Answers (1)

Ed Davisson
Ed Davisson

Reputation: 2927

This is not currently possible using the Cloud Datastore API.

Upvotes: 2

Related Questions