The following is an excerpt from "The Infinite Machine"
Say I’ve got an App Engine app managing user accounts. They have a store credit “balance”. As a promotion, I’d like to add $10 of free credit to everyone’s account.
I had a model class Account, with an attribute balance , and I wanted to increment every Account entity’s balance by 10.
That article was talking about the idea of serialising code, and presented the decorator @task to let me do this in background tasks. Here’s the code:
This was great, it made sure we could map over (ie: visit) every entity no matter how many there were, by using App Engine tasks...
Emlyn O'Regan is a Co-Founder and CTO of xapiapps, and the author of "The Infinite Machine"
A comprehensive guide to the changing world of learning design
Training Evidence Systems Services Pty Ltd © 2014-2019. Stirling Business Centre, 85 Mount Barker Road, Stirling, SA, Australia 5152