google app engine - Task Queues, Idempotence, and Objectify Transactions -



google app engine - Task Queues, Idempotence, and Objectify Transactions -

the documentation gae's task queue api states:

you can enqueue task part of datastore transaction, such task enqueued—and guaranteed enqueued—if transaction committed successfully.

however, documentation datastore transactions states twice should create them idempotent whenever possible, , submitting task queue not idempotent. documentation objectify takes step further, explaining work must idempotent within transactions.

so, there standard way handle combining these recommendations/requirements, or should roll own technique (perhaps using this)?

there concern task can execute twice (or more) - queue provides "at to the lowest degree once" semantics not "exactly once" semantics. common.

some operations easy create idempotent (eg, "set birthdate"). operations can hard create idempotent (eg, "transfer $5 business relationship account b"). hard ones, trick involves creating transaction id outside of start of transaction sequence , making sure id follows whole chain, through tasks. if retries , sees transaction id has been completed, can return.

google-app-engine objectify gae-ds-transactions

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -